From 39f15130f8db0280fcc7ab01016155b08ce1bdd9 Mon Sep 17 00:00:00 2001 From: dwmalone Date: Sun, 28 Jul 2002 15:41:15 +0000 Subject: 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(). --- usr.bin/csplit/csplit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.1