This is the mail archive of the
mailing list for the libstdc++ project.
Re: Debug mode output broken
Jonathan Wakely wrote:
Ah, ok then, one risk of buffer overlow less ;)
Except _M_format_word() isn't called on the expanded string, so that's
not a problem.
As I said we should really avoid all those dangerous functions and rewrite
The unexpanded string still needs to be short enough to
fit in the buffer though.
Maybe this should be added to _M_print_string(), before the while loop:
cleanly the code to use stringstreams or file streams directly. Without
the 3.4 ABI, however, it's not so easy :(
AFAICT FreeBSD has had snprintf() since version 1.0 (see )
so the test _could_ be changed to:
In general, the mere presence of something named snprintf is not sufficient:
we need the specific version standardized in C99. In particular, the first
implementations had a different, less useful, return value.