diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2002-07-28 15:41:15 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2002-07-28 15:41:15 +0000 |
commit | 39f15130f8db0280fcc7ab01016155b08ce1bdd9 (patch) | |
tree | f4ed153645dac13fbdcd6fa9e1b4f659cb079a5a /usr.bin/csplit/csplit.c | |
parent | 1dca0716ff1ea0fb36f4fe4386d04eff1bc72091 (diff) | |
download | FreeBSD-src-39f15130f8db0280fcc7ab01016155b08ce1bdd9.zip FreeBSD-src-39f15130f8db0280fcc7ab01016155b08ce1bdd9.tar.gz |
The return value of snprintf should be always nonnegative, so it should
be safe to cast it to a size_t before comparing it to a sizeof().
Diffstat (limited to 'usr.bin/csplit/csplit.c')
-rw-r--r-- | usr.bin/csplit/csplit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/csplit/csplit.c b/usr.bin/csplit/csplit.c index 35614be..cdf5f01 100644 --- a/usr.bin/csplit/csplit.c +++ b/usr.bin/csplit/csplit.c @@ -234,7 +234,7 @@ newfile(void) { FILE *fp; - if (snprintf(currfile, sizeof(currfile), "%s%0*ld", prefix, + if ((size_t)snprintf(currfile, sizeof(currfile), "%s%0*ld", prefix, (int)sufflen, nfiles) >= sizeof(currfile)) { errno = ENAMETOOLONG; err(1, NULL); |