From 2367266604531546448132489380bf782a75a9d5 Mon Sep 17 00:00:00 2001 From: zaCade Date: Wed, 7 Dec 2022 14:44:04 +0100 Subject: [PATCH] ExtraCommands+ForceInputs: Prevent strncmp with -1 (Crashes on newer sourcemods) --- ExtraCommands/scripting/ExtraCommands.sp | 4 +++- ForceInputs/scripting/ForceInputs.sp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ExtraCommands/scripting/ExtraCommands.sp b/ExtraCommands/scripting/ExtraCommands.sp index c98a1a7e..a7ace444 100644 --- a/ExtraCommands/scripting/ExtraCommands.sp +++ b/ExtraCommands/scripting/ExtraCommands.sp @@ -1281,7 +1281,9 @@ public Action Command_WAILA(int client, int argc) char sArgument[256]; GetCmdArg(1, sArgument, sizeof(sArgument)); - int Wildcard = FindCharInString(sArgument, '*'); + int Wildcard = -1; + if((Wildcard = FindCharInString(sArgument, '*')) == -1) + Wildcard = 256; int entity = INVALID_ENT_REFERENCE; while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE) diff --git a/ForceInputs/scripting/ForceInputs.sp b/ForceInputs/scripting/ForceInputs.sp index 21735156..78965d44 100644 --- a/ForceInputs/scripting/ForceInputs.sp +++ b/ForceInputs/scripting/ForceInputs.sp @@ -168,7 +168,9 @@ public Action Command_ForceInput(int client, int args) } else { - int Wildcard = FindCharInString(sArguments[0], '*'); + int Wildcard = -1; + if((Wildcard = FindCharInString(sArguments[0], '*')) == -1) + Wildcard = 256; int entity = INVALID_ENT_REFERENCE; while((entity = FindEntityByClassname(entity, "*")) != INVALID_ENT_REFERENCE)