fix potential crash on startup

thx hanicef
This commit is contained in:
Alug committed 2025-04-24 06:56:57 +02:00
1 parent d1ba4c61d7
commit aad83a3a9b
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')