- fixed cheat args parser.

Fixes 139
This commit is contained in:
Christoph Oelckers 2020-08-10 20:18:21 +02:00
parent f6162899de
commit ddf238ff19

View file

@ -365,7 +365,7 @@ bool bPlayerCheated = false;
static int parseArgs(char *pzArgs, int *nArg1, int *nArg2) static int parseArgs(char *pzArgs, int *nArg1, int *nArg2)
{ {
if (!nArg1 || !nArg2) if (!nArg1 || !nArg2 || strlen(pzArgs) < 3)
return -1; return -1;
*nArg1 = pzArgs[0] - '0' - 1; *nArg1 = pzArgs[0] - '0' - 1;
*nArg2 = (pzArgs[1] - '0')*10+(pzArgs[2]-'0') - 1; *nArg2 = (pzArgs[1] - '0')*10+(pzArgs[2]-'0') - 1;