From 235f747e2df80d9899497595a2b649e7d6df8601 Mon Sep 17 00:00:00 2001 From: Mark Benvenuto Date: Wed, 17 Dec 2014 14:11:41 -0500 Subject: snprintf - Implement a custom version of snprintf match the truncation behavior of C99 standard snprintf until MSVC supports snprintf. --- src/include/os_windows.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/include/os_windows.h') diff --git a/src/include/os_windows.h b/src/include/os_windows.h index b4ff458a10f..aa39f1f44ab 100644 --- a/src/include/os_windows.h +++ b/src/include/os_windows.h @@ -30,9 +30,14 @@ typedef uint32_t u_int; typedef unsigned char u_char; typedef unsigned long u_long; -/* < VS 2013 is not C99 compat */ +/* <= VS 2013 is not C99 compat */ #if _MSC_VER < 1900 -#define snprintf _snprintf +#define snprintf _wt_snprintf + +_Check_return_opt_ int __cdecl _wt_snprintf( + _Out_writes_(_MaxCount) char * _DstBuf, + _In_ size_t _MaxCount, + _In_z_ _Printf_format_string_ const char * _Format, ...); #endif /* -- cgit v1.2.1