fix potential crash on startup

thx hanicef
This commit is contained in:
Alug committed 2025-04-24 09:24:05 +02:00
1 parent cf92df5faa
commit 7bb4b74c65
1 file changed
+1 -1
+1 -1
View File
@@ -1022,7 +1022,7 @@ INT32 G_KeyStringtoNum(const char *keystr)
if (!keystr[0])
return 0;
if (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z')
if (!keystr[0] || (!keystr[1] && keystr[0] > ' ' && keystr[0] <= 'z'))
return keystr[0];
if (!strncmp(keystr, "KEY", 3) && keystr[3] >= '0' && keystr[3] <= '9')