From 74e7629e68ecfa8f764879d5553a5801451e11bb Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 19 Dec 2015 10:07:11 +0000 Subject: [PATCH] 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.) --- misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc.c b/misc.c index 0ce3d366..5ff403d6 100644 --- a/misc.c +++ b/misc.c @@ -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