Thread (38 messages) flat view 38 messages, 10 authors, 2016-08-13
STALE3682d

[PATCH 03/14] Define SNPRINTF_SIZE_CORR=1 for Microsoft Visual C++

From: Marius Storm-Olsen <hidden>
Date: 2016-06-15 22:47:17
Subsystem: the rest · Maintainer: Linus Torvalds

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help