From 077469cbab3225a2385f2d93ccc148065f6e38a9 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Thu, 13 Dec 2018 12:01:07 -0500 Subject: [PATCH] Fix savegamename being improperly built due to missing null char after copying timeattackfolder --- src/dehacked.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8cb70412..ccb25810 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3134,7 +3134,7 @@ static void readmaincfg(MYFILE *f) strncpy(timeattackfolder, gamedatafilename, filenamelen); timeattackfolder[min(filenamelen, sizeof (timeattackfolder) - 1)] = '\0'; - strncpy(savegamename, timeattackfolder, strlen(timeattackfolder)); + strcpy(savegamename, timeattackfolder); strlcat(savegamename, "%u.ssg", sizeof(savegamename)); // can't use sprintf since there is %u in savegamename strcatbf(savegamename, srb2home, PATHSEP);