bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vasnprintf.c minor overflow cleanup


From: Paul Eggert
Subject: vasnprintf.c minor overflow cleanup
Date: Fri, 25 Feb 2005 23:39:43 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux)

I installed this very minor patch:

2005-02-25  Paul Eggert  <address@hidden>

        * vasnprintf.c (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.

--- vasnprintf.c        7 Feb 2005 16:49:58 -0000       1.6
+++ vasnprintf.c        26 Feb 2005 07:37:49 -0000      1.7
@@ -295,7 +295,7 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *l
                          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;
                            }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]