bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] Re: vasnprintf cleanup


From: Simon Josefsson
Subject: [Bug-gnulib] Re: vasnprintf cleanup
Date: Fri, 15 Oct 2004 11:17:38 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Derek Robert Price <address@hidden> writes:

> Hey all,
>
> Attached is a very short patch which updates vasnprintf to not access
> lengthp when resultbuf == NULL and lengthp == NULL to avoid annoying
> artificial constructs like the following:
>
>     ...coding happily away...
>     ...
>     {
>        size_t dummy;
>        somevar = asnprintf (NULL, &dummy, "%s/%s", foo, bar);
>     }
>     ...

I agree with your patch, but FYI, there is asprintf, which seem more
appropriate than asnprintf in this situation.





reply via email to

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