Skip to content

Commit bf6cc03

Browse files
committed
Fix tests for MSVC <= 2013
Use the _TRUNCATE flag for the count parameter to _snprintf_s. Without this, the tests for MSVC <= 2013 failed on stack corruption!
1 parent a6bf728 commit bf6cc03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/msgpack/sysdep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <stddef.h>
1515

1616
#if defined(_MSC_VER) && _MSC_VER <= 1800
17-
# define snprintf(buf, len, format,...) _snprintf_s(buf, len, len, format, __VA_ARGS__)
17+
# define snprintf(buf, len, format,...) _snprintf_s(buf, len, _TRUNCATE, format, __VA_ARGS__)
1818
#endif
1919

2020
#if defined(_MSC_VER) && _MSC_VER < 1600

0 commit comments

Comments
 (0)