summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-07-28 15:41:15 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-07-28 15:41:15 +0000
commit39f15130f8db0280fcc7ab01016155b08ce1bdd9 (patch)
treef4ed153645dac13fbdcd6fa9e1b4f659cb079a5a /usr.bin
parent1dca0716ff1ea0fb36f4fe4386d04eff1bc72091 (diff)
downloadFreeBSD-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')
-rw-r--r--usr.bin/csplit/csplit.c2
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);
OpenPOWER on IntegriCloud