1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

Use the proper snprintf function if compiling with VS2015.

Proper snprintf is finally supported as of the latest Visual Studio,
and has better semantics for my purposes than the old MS-specific
_snprintf. (Specifically, if its output doesn't fit the buffer, it
returns the full size it _would_ have wanted, so that you can then
immediately allocate that much space, and don't have to keep going
round a loop increasing the buffer size until you find the answer.)
This commit is contained in:
Simon Tatham 2015-12-19 10:07:11 +00:00
parent 7ca84b4d68
commit 74e7629e68

2
misc.c
View File

@ -412,7 +412,7 @@ char *dupvprintf(const char *fmt, va_list ap)
size = 512;
while (1) {
#ifdef _WINDOWS
#if defined _WINDOWS && _MSC_VER < 1900 /* 1900 == VS2015 has real snprintf */
#define vsnprintf _vsnprintf
#endif
#ifdef va_copy