[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] xvasprintf and xasprintf
From: |
Oskar Liljeblad |
Subject: |
Re: [Bug-gnulib] xvasprintf and xasprintf |
Date: |
Thu, 26 Aug 2004 17:41:30 +0200 |
User-agent: |
Mutt/1.5.6+20040803i |
On Thursday, August 26, 2004 at 14:29, Bruno Haible wrote:
Hi Bruno,
> A similar function exists in GNU gettext:
>
> /* Format a message and return the freshly allocated resulting string. */
> extern char *xasprintf (const char *format, ...)
> __attribute__ ((__format__ (__printf__, 1, 2)));
>
> Why do you prefer the function to return an 'int' and the caller to do
> error checking against other failures?
[..]
Maybe the xasprintf in gettext could be added as well, but with
a different name? Maybe something like xstr[ing]f and str[ing]f,
both allocating memory, only the latter can return NULL...
Possibly too overkill.
asnprintf and vasnprintf in gnulib suffer from the same problem
as xasprintf in gettext though - there's no way of knowing
exactly how many characters were written...
> Small nits in the patch:
[..]
New patch attached!
Regards,
Oskar Liljeblad (address@hidden)