Allow snprintf() usage on all platforms
snprintf() is only included in C99, not in C89 or the C++ standard, and of course, doesn't work (or at least didn't work a year ago when I tested) in the Visual Studio C compiler... However, it would be immensely useful, both for security and reliability, to be able to use it in many places in the code (it's very difficult to format output for storage in a string safely without snprintf()). A workaround would be very useful (or a confirmation that it actually works in VC, at least in the C++ mode); I think that Visual Studio provides a _snprintf() function that differs a bit in the return value, but would still be better than nothing.
#1 Updated by Teemu Murtola almost 10 years ago
Sander's commit 02dd4b31130b63f580f6da6156214f6611433819 now allows basic usage of snprintf() on Windows as well; we might also want to write an additional wrapper (possibly only in the master branch once C++ is enabled to avoid manual memory management in the caller) that allocates the output buffer dynamically to fit the message, hiding the different return value semantics on different platforms.