From: Frank Li <redacted>
The Microsoft C runtime's vsnprintf function does not add NUL at
the end of the buffer.
Signed-off-by: Frank Li <redacted>
Signed-off-by: Marius Storm-Olsen <redacted>
---
compat/snprintf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/compat/snprintf.c b/compat/snprintf.c
index 6c0fb05..37b1edf 100644
--- a/compat/snprintf.c
+++ b/compat/snprintf.c
@@ -6,7 +6,7 @@
* number of characters to write without the trailing NUL.
*/
#ifndef SNPRINTF_SIZE_CORR
-#if defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4
+#if (defined(__MINGW32__) && defined(__GNUC__) && __GNUC__ < 4) || defined(_MSC_VER)
#define SNPRINTF_SIZE_CORR 1
#else
#define SNPRINTF_SIZE_CORR 0
--
1.6.3.msysgit.0.18.gef407