From: Paul Eggert Date: Sat, 26 Feb 2005 07:37:49 +0000 (+0000) Subject: (VASNPRINTF) [!USE_SNPRINTF]: Correct the test for X-Git-Tag: CPPI-1_12~1409 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8d8d339d311bfabb16b557141de38aec1b6e5a8;p=thirdparty%2Fcoreutils.git (VASNPRINTF) [!USE_SNPRINTF]: Correct the test for integer overflow again. Actually, neither this nor the 2005-01-23 change fixes any bug on any plausible platform; it's more of a code-clarity thing. --- diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index c4c1664670..a21134016f 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -295,7 +295,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar do { size_t w_tmp = width * 10 + (*digitp++ - '0'); - if (SIZE_MAX / 10 <= width || w_tmp < width) + if (SIZE_MAX / 10 < width || w_tmp < width) goto out_of_memory; width = w_tmp; }