From 8109bbcb59ac886858f90e38cc1e7adf64788f45 Mon Sep 17 00:00:00 2001 From: MysterD Date: Wed, 2 Feb 2022 20:26:48 -0800 Subject: [PATCH] Fixed hang related to mod incompatibility checking --- src/pc/mod_list.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pc/mod_list.c b/src/pc/mod_list.c index 43139814d..549536074 100644 --- a/src/pc/mod_list.c +++ b/src/pc/mod_list.c @@ -212,9 +212,11 @@ static bool mod_list_incompatible_match(struct ModListEntry* a, struct ModListEn char* bi = b->incompatible; char* atoken = NULL; char* btoken = NULL; + char* arest = NULL; + char* brest = NULL; - while ((atoken = strtok(ai, " "))) { - while((btoken = strtok(bi, " "))) { + for (atoken = strtok_r(ai, " ", &arest); atoken != NULL; atoken = strtok_r(NULL, " ", &arest)) { + for (btoken = strtok_r(bi, " ", &brest); btoken != NULL; btoken = strtok_r(NULL, " ", &brest)) { if (!strcmp(atoken, btoken)) { return true; }