]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(VASNPRINTF) [!USE_SNPRINTF]: Correct the test for
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Feb 2005 07:37:49 +0000 (07:37 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Feb 2005 07:37:49 +0000 (07:37 +0000)
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.

lib/vasnprintf.c

index c4c16646704ba1764af7bec7c8d0c80d8b418879..a21134016f03e8b6dad2a6f64ae8894152d81a51 100644 (file)
@@ -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;
                            }