ExtraCommands+ForceInputs: Prevent strncmp with -1 (Crashes on newer sourcemods)

This commit is contained in:
zaCade 2022-12-07 14:44:04 +01:00
parent 7f96f547c9
commit 2367266604
2 changed files with 6 additions and 2 deletions

View File

@ -1281,7 +1281,9 @@ public Action Command_WAILA(int client, int argc)
char sArgument[256]; char sArgument[256];
GetCmdArg(1, sArgument, sizeof(sArgument)); GetCmdArg(1, sArgument, sizeof(sArgument));
int Wildcard = FindCharInString(sArgument, '*'); int Wildcard = -1;
if((Wildcard = FindCharInString(sArgument, '*')) == -1)
Wildcard = 256;
int entity = INVALID_ENT_REFERENCE; int entity = INVALID_ENT_REFERENCE;
while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE) while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE)

View File

@ -168,7 +168,9 @@ public Action Command_ForceInput(int client, int args)
} }
else else
{ {
int Wildcard = FindCharInString(sArguments[0], '*'); int Wildcard = -1;
if((Wildcard = FindCharInString(sArguments[0], '*')) == -1)
Wildcard = 256;
int entity = INVALID_ENT_REFERENCE; int entity = INVALID_ENT_REFERENCE;
while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE) while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE)