On Tue, 2009-11-24 at 21:24 +0100, Andreas Fritiofson wrote:
> The previous implementation was unnecessarily complex. Get rid of the loops,
> let vsnprintf() tell us directly how much storage we need and allocate that. A
> second pass writes the actual string. Also add a va_end() that was missing.
The previous implementation was unnecessarily complex. Get rid of the loops,
let vsnprintf() tell us directly how much storage we need and allocate that. A
second pass writes the actual string. Also add a va_end() that was missing.
This should be much faster for large strings and less wasteful for
Looks great, but one minor comment below
On Tue, 2009-11-24 at 00:37 +0100, Andreas Fritiofson wrote:
> The previous implementation was unnecessarily complex. Get rid of the loops,
> let vsnprintf() tell us directly how much storage we need and allocate that. A
> second pass writes the actual
The previous implementation was unnecessarily complex. Get rid of the loops,
let vsnprintf() tell us directly how much storage we need and allocate that. A
second pass writes the actual string. Also add a va_end() that was missing.
This should be much faster for large strings and less wasteful for