Messages in this thread | | | Subject | Re: [PATCH] perf: Incorrect use of snprintf results in SEGV | From | Peter Zijlstra <> | Date | Wed, 07 Mar 2012 21:59:24 +0100 |
| |
On Wed, 2012-03-07 at 21:37 +0100, Ingo Molnar wrote: > size_needed = snprintf_size(...);
This would require 3 passes over the fmt+args, first to find the allocated size is insufficient, 2nd to compute the size, 3rd to fill buffer.
Whereas with the current "creative" API only 2 passes are needed.
I can imagine that back in the day of small memory and small CPU this was deemed important enough.
Anyway, its all moot, this API exists and has been out in the wild for several decades now, its not like we can actually change it :-)
| |