diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index d2c8f3b25..d05406910 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -2026,7 +2026,20 @@ static int PatchPars (int dummy) if (stricmp ("par", Line1)) return result; - space = strchr (Line2, ' '); + const auto FindSpace = [](char* str) -> char* + { + while ('\0' != *str) + { + if (isspace(*str)) + { + return str; + } + ++str; + } + return nullptr; + }; + + space = FindSpace (Line2); if (!space) { Printf ("Need data after par.\n"); @@ -2038,7 +2051,7 @@ static int PatchPars (int dummy) while (*space && isspace(*space)) space++; - moredata = strchr (space, ' '); + moredata = FindSpace (space); if (moredata) { // At least 3 items on this line, must be E?M? format