diff options
Diffstat (limited to 'lib/libc/gen/getbsize.c')
-rw-r--r-- | lib/libc/gen/getbsize.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/gen/getbsize.c b/lib/libc/gen/getbsize.c index f3fbece28ff..9ecff68119c 100644 --- a/lib/libc/gen/getbsize.c +++ b/lib/libc/gen/getbsize.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: getbsize.c,v 1.5 1997/08/24 21:25:45 millert Exp $"; +static char rcsid[] = "$OpenBSD: getbsize.c,v 1.6 1998/06/23 22:40:25 millert Exp $"; #endif /* not lint */ #include <err.h> @@ -101,6 +101,8 @@ underflow: _warnx("%s: minimum blocksize is 512", p); blocksize = n = 512; *headerlenp = snprintf(header, sizeof(header), "%ld%s-blocks", n, form); + if (*headerlenp >= sizeof(header)) + *headerlenp = sizeof(header) - 1; *blocksizep = blocksize; return (header); } |