From f11b767efc383f954455e049b7416a8595c1a18e Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sat, 4 Jan 2020 12:28:57 +0100 Subject: [PATCH] Fix string length : _snprintf() does not terminate strings properly see https://pulkomandy.tk/projects/GrafX2/ticket/131 --- src/help.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/help.c b/src/help.c index dfa1c928..36fb7de0 100644 --- a/src/help.c +++ b/src/help.c @@ -812,6 +812,11 @@ void Button_Stats(int btn) y=19; // row for first line Print_in_window(10,y,"Program version:",STATS_TITLE_COLOR,MC_Black); snprintf(buffer,20,"%s.%s",Program_version, SVN_revision); +#ifdef WIN32 +#if !defined(_MSC_VER) || _MSC_VER < 1900 + buffer[20-1] = '\0'; +#endif +#endif Print_in_window(146,y,buffer,STATS_DATA_COLOR,MC_Black); y+=8; #if defined(USE_SDL) || defined(USE_SDL2)