Fix savegamename being improperly built due to missing null char after copying timeattackfolder

This commit is contained in:
mazmazz 2018-12-13 12:01:07 -05:00
parent 8dd0c8dff8
commit 077469cbab

View file

@ -3134,7 +3134,7 @@ static void readmaincfg(MYFILE *f)
strncpy(timeattackfolder, gamedatafilename, filenamelen); strncpy(timeattackfolder, gamedatafilename, filenamelen);
timeattackfolder[min(filenamelen, sizeof (timeattackfolder) - 1)] = '\0'; timeattackfolder[min(filenamelen, sizeof (timeattackfolder) - 1)] = '\0';
strncpy(savegamename, timeattackfolder, strlen(timeattackfolder)); strcpy(savegamename, timeattackfolder);
strlcat(savegamename, "%u.ssg", sizeof(savegamename)); strlcat(savegamename, "%u.ssg", sizeof(savegamename));
// can't use sprintf since there is %u in savegamename // can't use sprintf since there is %u in savegamename
strcatbf(savegamename, srb2home, PATHSEP); strcatbf(savegamename, srb2home, PATHSEP);