diff options
author | Brian Somers <brian@FreeBSD.org> | 2001-08-20 15:09:33 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 2001-08-20 15:09:33 +0000 |
commit | 222cd6b5dd2760684ef7af02db4a34c483e41af4 (patch) | |
tree | 74a64473d0d9d53966ac2f18aeafa7eee55df712 /sysutils/diskcheckd | |
parent | Update misc/p5-Finance-Quote to 1.06. (diff) |
Handle snprintf() returning < 0 (not just -1)
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=46545
Diffstat (limited to 'sysutils/diskcheckd')
-rw-r--r-- | sysutils/diskcheckd/files/diskcheckd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sysutils/diskcheckd/files/diskcheckd.c b/sysutils/diskcheckd/files/diskcheckd.c index cb79a08944ba..0b41beca526b 100644 --- a/sysutils/diskcheckd/files/diskcheckd.c +++ b/sysutils/diskcheckd/files/diskcheckd.c @@ -443,7 +443,7 @@ updateproctitle(struct disk *disks) { p += sizeof _PATH_DEV - 1; percent = 100 * (double)dseek(dp, 0, SEEK_CUR) / dp->size; - if ((ret = snprintf(bp, size, "%s %.2f%%, ", p, percent)) == -1) + if ((ret = snprintf(bp, size, "%s %.2f%%, ", p, percent)) < 0) ret = 0; if ((size_t)ret >= size) { inc = ((ret + 1023) >> 10) << 10; @@ -457,7 +457,7 @@ updateproctitle(struct disk *disks) { } bp = buf + bufsize - size; ret = snprintf(bp, size, "%s %.2f%%, ", p, percent); - if (ret == -1) + if (ret < 0) ret = 0; } bp += ret; |