diff options
author | brian <brian@FreeBSD.org> | 2001-08-20 14:53:05 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-08-20 14:53:05 +0000 |
commit | 6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59 (patch) | |
tree | 43eccc3994dfc9fbe0ce6fb8ae79fc9900a73306 /sbin/newfs/mkfs.c | |
parent | 5bd90784a67de0a5e78e5bd967e2cd3d4f126cb7 (diff) | |
download | FreeBSD-src-6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59.zip FreeBSD-src-6820e8fb2d65a3b4d872ed5b1f5ae576f2dbcf59.tar.gz |
Handle snprintf() returning < 0 (not just -1)
MFC after: 2 weeks
Diffstat (limited to 'sbin/newfs/mkfs.c')
-rw-r--r-- | sbin/newfs/mkfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 84f0d9b..4772ae9 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -650,8 +650,8 @@ next: j = snprintf(tmpbuf, sizeof(tmpbuf), " %ld%s", fsbtodb(&sblock, cgsblock(&sblock, cylno)), cylno < (sblock.fs_ncg-1) ? "," : "" ); - if (j == -1) - j = 0; + if (j < 0) + tmpbuf[j = 0] = '\0'; if (i + j >= width) { printf("\n"); i = 0; |