From 3fb6d1a18067a0d8c49f1b05e051fd74b9f12b30 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Mon, 28 Jun 2021 09:00:21 +0200 Subject: [PATCH] fix saving of the "window_position" config parameter --- Source/i_video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/i_video.c b/Source/i_video.c index c25293d6..9873419f 100644 --- a/Source/i_video.c +++ b/Source/i_video.c @@ -914,12 +914,12 @@ void I_ShutdownGraphics(void) // in the "window_position" config parameter SDL_GetWindowPosition(screen, &x, &y); M_snprintf(buf, sizeof(buf), "%i,%i", x, y); - buflen = strlen(buf); + buflen = strlen(buf) + 1; if (strlen(window_position) < buflen) { window_position = realloc(window_position, buflen); } - M_StringCopy(window_position, buf, sizeof(window_position)); + M_StringCopy(window_position, buf, buflen); UpdateGrab(); in_graphics_mode = false;