mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
strtok can return NULL
This commit is contained in:
parent
c7a8608a9b
commit
4b0774ddf9
1 changed files with 2 additions and 0 deletions
|
|
@ -320,6 +320,8 @@ HMS_fetch_servers (msg_server_t *list, int room_number)
|
||||||
section_end = strstr(p, "\n\n");
|
section_end = strstr(p, "\n\n");
|
||||||
room = strtok(p, "\n");
|
room = strtok(p, "\n");
|
||||||
p = strtok(0, "");
|
p = strtok(0, "");
|
||||||
|
if (! p)
|
||||||
|
break;
|
||||||
for (; i < MAXSERVERLIST && ( end = strchr(p, '\n') ); ++i)
|
for (; i < MAXSERVERLIST && ( end = strchr(p, '\n') ); ++i)
|
||||||
{
|
{
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue