From 1dfbe0fa83f0706be19ea9483c2518049afe30d3 Mon Sep 17 00:00:00 2001 From: Thomas Arp <357770+welcor@users.noreply.github.com> Date: Tue, 21 Apr 2026 23:10:46 +0200 Subject: [PATCH] Potential fix for code scanning alert no. 3: Redundant null check due to previous dereference (#172) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- src/dg_variables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dg_variables.c b/src/dg_variables.c index 0f2f63d..0930889 100644 --- a/src/dg_variables.c +++ b/src/dg_variables.c @@ -465,7 +465,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig, * will return the number of bags of gold. * Addition inspired by Jamie Nelson */ else if (!str_cmp(var, "findmob")) { - if (!field || !*field || !subfield || !*subfield) { + if (!*field || !subfield || !*subfield) { script_log("findmob.vnum(mvnum) - illegal syntax"); strcpy(str, "0"); } else {