mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-14 22:21:27 +00:00
- cap the size of the string copy calls in LevelStatEntry()
This commit is contained in:
parent
a14bba3561
commit
fe28defeca
1 changed files with 6 additions and 2 deletions
|
@ -343,8 +343,12 @@ static void LevelStatEntry(FSessionStatistics *es, const char *level, const char
|
|||
time (&clock);
|
||||
lt = localtime (&clock);
|
||||
|
||||
strcpy(s.name, level);
|
||||
strcpy(s.info, text);
|
||||
strncpy(s.name, level, sizeof(s.name) - 1);
|
||||
s.name[sizeof(s.name) - 1] = '\0';
|
||||
|
||||
strncpy(s.info, text, sizeof(s.info) - 1);
|
||||
s.info[sizeof(s.info) - 1] = '\0';
|
||||
|
||||
s.timeneeded=playtime;
|
||||
es->levelstats.Push(s);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue