Git development
 help / color / mirror / Atom feed
* [PATCH 1/2] MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more
@ 2016-03-29 16:25 Sven Strickroth
  2016-03-29 16:43 ` Junio C Hamano
  2016-03-29 19:09 ` Sebastian Schuberth
  0 siblings, 2 replies; 7+ messages in thread
From: Sven Strickroth @ 2016-03-29 16:25 UTC (permalink / raw)
  To: Git List, Junio C Hamano, Sebastian Schuberth, blees

In MSVC2015 the behavior of vsnprintf was changed.
W/o this fix there is one character missing at the end.

Signed-off-by: Sven Strickroth <sven@cs-ware.de>
---
 compat/snprintf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compat/snprintf.c b/compat/snprintf.c
index 42ea1ac..0b11688 100644
--- a/compat/snprintf.c
+++ b/compat/snprintf.c
@@ -9,7 +9,7 @@
  * always have room for a trailing NUL byte.
  */
 #ifndef SNPRINTF_SIZE_CORR
-#if defined(WIN32) && (!defined(__GNUC__) || __GNUC__ < 4)
+#if defined(WIN32) && (!defined(__GNUC__) || __GNUC__ < 4) && (!defined(_MSC_VER) || _MSC_VER < 1900)
 #define SNPRINTF_SIZE_CORR 1
 #else
 #define SNPRINTF_SIZE_CORR 0
-- 
2.7.4.windows.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-30  7:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-29 16:25 [PATCH 1/2] MSVC: vsnprintf in Visual Studio 2015 doesn't need SNPRINTF_SIZE_CORR any more Sven Strickroth
2016-03-29 16:43 ` Junio C Hamano
2016-03-29 19:09 ` Sebastian Schuberth
2016-03-29 19:13   ` Sven Strickroth
2016-03-29 19:20     ` Sebastian Schuberth
2016-03-30  7:49       ` Johannes Schindelin
2016-03-30  7:57         ` Sebastian Schuberth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox