From 56fac10b14f48552339ee529b1b13edad40e008c Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 1 Mar 2020 12:15:48 -0800 Subject: [PATCH] strtok can return NULL --- src/hms123311.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hms123311.c b/src/hms123311.c index 7feea859..b05c148a 100644 --- a/src/hms123311.c +++ b/src/hms123311.c @@ -320,6 +320,8 @@ HMS_fetch_servers (msg_server_t *list, int room_number) section_end = strstr(p, "\n\n"); room = strtok(p, "\n"); p = strtok(0, ""); + if (! p) + break; for (; i < MAXSERVERLIST && ( end = strchr(p, '\n') ); ++i) { *end = '\0';