1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Avoid using _vsnprintf on MinGW.

We went to the trouble of getting standard C99 format strings with
__USE_MINGW_ANSI_STDIO, but then used _vsnprintf, which bypasses them
and implements the non-standard Microsoft format strings, leading to
incorrect behaviour.
Ubuntu 14.04's mingw-w64 at least defines a vsnprintf() in all
circumstances, so we should use it.
This commit is contained in:
Jacob Nevins 2019-04-21 12:54:39 +01:00
parent 65b3c93a8e
commit 134dc0bcaf

View File

@ -308,7 +308,10 @@ int string_length_for_printf(size_t s)
#endif
/* Also lack of vsnprintf before VS2015 */
#if defined _WINDOWS && !defined __WINE__ && _MSC_VER < 1900
#if defined _WINDOWS && \
!defined __MINGW32__ && \
!defined __WINE__ && \
_MSC_VER < 1900
#define vsnprintf _vsnprintf
#endif