bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] Re: snprintf


From: Simon Josefsson
Subject: [Bug-gnulib] Re: snprintf
Date: Fri, 01 Oct 2004 17:27:59 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Bruno Haible <address@hidden> writes:

>> >  - Why do you let vasnprintf allocate the entire string if, afterwards,
>> >    you only need size bytes of it? You could already tell vasnprintf
>> >    to produce less memory.
>>
>> How?
>
> Oops, I was wrong. It's the other case that you can optimize: Avoid
> malloc() and free() when the result will have less than size bytes.

I don't understand, could you be more specific?  snprintf still need
to return the full length, so it has to be computed somehow.

Thanks.





reply via email to

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