(no title)
vore
|
2 years ago
How do you know how much memory you need to allocate when you need to do the work in the first place to determine it? Maybe if snprintf was resumable by supplying a larger buffer while it was doing its work, but this seems like a lot of complexity.
charcircuit|2 years ago
With the approach of having the caller allocate you have carefully design the API to make it possible.