Ryan Bloom wrote:
On Fri, 23 Aug 2002, Jim Jagielski wrote:
We are already not compliant, since we overload %p.
Not sure if I understand #1: If len is 0, we return 0 and don't check
buff at all. Or do you mean a length of 0 (or 1) should set
*buffer to NULL?
right now, if length is 0, we return 0, and that is it. However, the spec
says that if length is zero, then *buffer is allowed to be NULL, but
whether it is or isn't, *buffer isn't modified, and snprintf returns the
number of characters that _would_ be returned if length was infinite.
An example:
apr_snprintf(p, NULL, 0, "%s BAR", "FOO");
currently returns 0, after the changes, it would return 7.
8, surely?
Cheers,
Ben.
--
http://www.apache-ssl.org/ben.html http://www.thebunker.net/
Available for contract work.
"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff