bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] xvasprintf typo fix


From: Bruno Haible
Subject: Re: [bug-gnulib] xvasprintf typo fix
Date: Wed, 28 Jun 2006 18:22:22 +0200
User-agent: KMail/1.9.1

Eric Blake wrote:
> I noticed a copy-n-paste error from vasprintf.h, so I installed this trivial 
> fix:
>  
>  /* Write formatted output to a string dynamically allocated with malloc().
> -   If the memory allocation succeeds, store the address of the string in
> -   *RESULT and return the number of resulting bytes, excluding the trailing
> -   NUL.  Upon [ENOMEM] memory allocation error, call xalloc_die.
> +   Upon [ENOMEM] memory allocation error, call xalloc_die.
>     On some other error
>       - [EOVERFLOW] resulting string length is > INT_MAX,

Well, this loses the info what is the return value of the function.
It's not hard to guess, but you have to guess. I installed this fix:

--- xvasprintf.h        28 Jun 2006 14:00:22 -0000      1.3
+++ xvasprintf.h        28 Jun 2006 16:22:27 -0000
@@ -38,8 +38,8 @@
 extern "C" {
 #endif
 
-/* Write formatted output to a string dynamically allocated with malloc().
-   Upon [ENOMEM] memory allocation error, call xalloc_die.
+/* Write formatted output to a string dynamically allocated with malloc(),
+   and return it.  Upon [ENOMEM] memory allocation error, call xalloc_die.
    On some other error
      - [EOVERFLOW] resulting string length is > INT_MAX,
      - [EINVAL] invalid format string,

Bruno




reply via email to

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