strtok can return NULL

This commit is contained in:
James R 2020-03-01 12:15:48 -08:00
parent 9e0c1b3f1f
commit 768ad80a97

View file

@ -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';