Re: [PATCH] Add compat/vsnprintf.c for systems that returns -1 on maxsize reached
- From
Wayne Davison <wayne@opencoder.net>
- Date
- Mar 5, 2008, 22:33 UTC
- Message-ID
- <20080305223342.GA9620@herod.dreamhost.com>
- In-Reply-To
- <47CEC47C.6060505@viscovery.net>
On Wed, Mar 05, 2008 at 05:04:12PM +0100, Johannes Sixt wrote:
> If one *printf function is replaced, all of them must be replaced. The > reason is that, eg. on Windows we don't have %llu, but we have %I64u.
Or the compatibility function would need to know which escapes to emulate (or even emulate a super-set of escapes, as long as they don't conflict). If the calling code already has a way to know which escapes to use, then the compatibility code could easily be customized to handle the right ones in the same way.
If the decision is made to not use a compatibility snprintf library, then configure will need a separate test for the limit being off by one, and then a fixing function would need to pass through limit-1.
..wayne..