[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] Re: snprintf
From: |
Bruno Haible |
Subject: |
Re: [Bug-gnulib] Re: snprintf |
Date: |
Fri, 1 Oct 2004 22:30:51 +0200 |
User-agent: |
KMail/1.5 |
Simon Josefsson wrote:
> 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).
OK, I'll add a comment about it.
> Do all vasnprintf implementations behave the same?
Other vasnprintf implementations have a different prototype:
int vasnprintf (char **, size_t, const char *, ...);
> If not, do the vasnprintf M4 macro test for it?
It doesn't because I'm not aware of a vasnprintf() function in any system's
libc.
> I'm assuming snprintf(4711, 0, "foo") should not access memory at 4711,
> but still return 3.
Yes, I agree.
> Also, if size==0, it seems your version might dereference STR (inside
> vasnprintf), which also seems bad.
Works for me. All memory accesses are protected by ENSURE_ALLOCATION.
Bruno