Skip to content

Commit 99954a2

Browse files
authored
Fix crash caused by ReloadMapCycleFile function (#576)
* Fix crash caused by ReloadMapCycleFile function
2 parents a8802e6 + bbfc3fe commit 99954a2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

regamedll/dlls/multiplay_gamerules.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4418,7 +4418,12 @@ int ReloadMapCycleFile(char *filename, mapcycle_t *cycle)
44184418
if (Q_strlen(pToken) <= 0)
44194419
break;
44204420

4421+
#ifdef REGAMEDLL_FIXES
4422+
Q_strncpy(szMap, pToken, sizeof(szMap) - 1);
4423+
szMap[sizeof(szMap) - 1] = '\0';
4424+
#else
44214425
Q_strcpy(szMap, pToken);
4426+
#endif
44224427

44234428
// Any more tokens on this line?
44244429
if (SharedTokenWaiting(pFileList))

0 commit comments

Comments
 (0)