- fixed crash on parsing bad hex number

https://forum.zdoom.org/viewtopic.php?t=65718
This commit is contained in:
alexey.lysiuk 2019-08-25 11:21:44 +03:00
parent 574e079f17
commit cc1f18a328

View file

@ -1283,7 +1283,8 @@ int ParseHex(const char* hex, FScriptPosition* sc)
else if (*str >= 'A' && *str <= 'F')
num += 10 + *str - 'A';
else {
sc->Message(MSG_WARNING, "Bad hex number: %s", hex);
if (sc) sc->Message(MSG_WARNING, "Bad hex number: %s", hex);
else Printf("Bad hex number: %s\n", hex);
return 0;
}
str++;