https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68737

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to dave.anglin from comment #11)
> JAGaf47646: with small buffer vsnprintf always returns -1

Aha, that is probably it. We pass 0 as the size, which is supposed to make
vsnprintf tell you how many bytes it would have written (as that's how we find
out the required length).

It's curious that it printed "returned 4, errno = 0" when you tested it though.
Maybe GCC optimized the call and didn't use the OS function.

Does it return -1 if you use -fno-builtin-vsnprintf ?

Reply via email to