bug-gnulib
[Top][All Lists]
Advanced

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

Re: another vasnprintf fix


From: Bruno Haible
Subject: Re: another vasnprintf fix
Date: Tue, 20 Mar 2007 01:46:43 +0100
User-agent: KMail/1.5.4

Eric Blake wrote:
> since vasnprintf has the
> nice API property that, unlike all other *printf functions, it does not
> return an int, it should not need to be limited by INT_MAX; otherwise you
> are introducing an artificial limitation

You're right; I forgot about this argumentation. My patch contradicted a
comment at the end of the function. Undone:


2007-03-18  Bruno Haible  <address@hidden>

        * lib/vasnprintf.c (VASNPRINTF): Undo first part of last patch.
        Suggested by Eric Blake.

*** lib/vasnprintf.c    18 Mar 2007 00:31:50 -0000      1.30
--- lib/vasnprintf.c    19 Mar 2007 00:57:09 -0000
***************
*** 184,193 ****
        {
        result = resultbuf;
        allocated = *lengthp;
-       /* POSIX says that snprintf() fails with EOVERFLOW when the specified
-          buffer size is larger than INT_MAX.  Let's do the same here.  */
-       if (allocated > INT_MAX)
-         goto overflow;
        }
      else
        {
--- 184,189 ----





reply via email to

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