Libiberty's snprintf for v3?

Paolo Carlini pcarlini@unitus.it
Tue Apr 22 07:32:00 GMT 2003


Nathan Myers wrote:

>It seems to me that we should be able to establish an upper bound
>on the number of characters that can be produced by a printf format
>for these uses, so that sprintf itself should be safe.  What am I 
>missing?
>
Nothing, actually ;)
I did my best to establish good upper bounds (with your help at least 
one time, I seem to recall) but, nevertheless, I'm still finding 'safer' 
the built-in logic present in snprintf and I like the simplifications 
made possible by a snprintf unconditionally available on any platform 
(both C99 e C90).

Paolo.

P.S. Of course, in the long term Jerry will format floats too without 
relying on s[n]printf...




More information about the Libstdc++ mailing list