mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-31 04:02:37 +00:00
ParseTextmapThingParameter: Tidier, more explicit guarantees for null-terminated stringarg handling
This commit is contained in:
parent
e1d6455446
commit
ea8573a70a
1 changed files with 4 additions and 2 deletions
|
|
@ -1807,8 +1807,10 @@ static void ParseTextmapThingParameter(UINT32 i, const char *param, const char *
|
|||
size_t argnum = atol(param + 9);
|
||||
if (argnum >= NUMMAPTHINGSTRINGARGS)
|
||||
return;
|
||||
mapthings[i].stringargs[argnum] = Z_Malloc(strlen(val) + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(mapthings[i].stringargs[argnum], val, strlen(val) + 1);
|
||||
size_t len = strlen(val);
|
||||
mapthings[i].stringargs[argnum] = Z_Malloc(len + 1, PU_LEVEL, NULL);
|
||||
M_Memcpy(mapthings[i].stringargs[argnum], val, len);
|
||||
mapthings[i].stringargs[argnum][len] = '\0';
|
||||
}
|
||||
else if (fastncmp(param, "arg", 3) && strlen(param) > 3)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue