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 22:03:11 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Simon Josefsson wrote:
>> I don't understand, could you be more specific?  snprintf still need
>> to return the full length, so it has to be computed somehow.
>
> What I meant is this. Does this look OK?

I not sure.

If vasnprintf really doesn't realloc the input string (which I also
thought initially), that should be mentioned in the vasnprintf
documentation (it doesn't give that impression now).  It seems like a
critical interface dependency.  Do all vasnprintf implementations
behave the same?  If not, do the vasnprintf M4 macro test for it?

Also, if size==0, it seems your version might dereference STR (inside
vasnprintf), which also seems bad.  I'm assuming snprintf(4711, 0,
"foo") should not access memory at 4711, but still return 3.

Thanks.





reply via email to

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