]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect-fast-pattern: remove unused var alertcnt 8758/head
authorJason Ish <jason.ish@oisf.net>
Mon, 24 Apr 2023 20:49:18 +0000 (14:49 -0600)
committerJason Ish <jason.ish@oisf.net>
Mon, 24 Apr 2023 22:00:13 +0000 (16:00 -0600)
Set, but never read.

Caught by -Wunused-but-set-variable which is enabled in the newer
Fedora CI builders.

src/detect-fast-pattern.c

index 408aafe4b6afdd35e79d517f5c1a0376eefd0840..5860d472f6787925c3f06463275fa44295ba56e5 100644 (file)
@@ -520,7 +520,6 @@ static int DetectFastPatternTest14(void)
     Packet *p = NULL;
     ThreadVars th_v;
     DetectEngineThreadCtx *det_ctx = NULL;
-    int alertcnt = 0;
     int result = 0;
 
     memset(&th_v, 0, sizeof(th_v));
@@ -548,9 +547,7 @@ static int DetectFastPatternTest14(void)
     DetectEngineThreadCtxInit(&th_v, (void *)de_ctx, (void *)&det_ctx);
 
     SigMatchSignatures(&th_v, de_ctx, det_ctx, p);
-    if (PacketAlertCheck(p, 1)){
-        alertcnt++;
-    }else{
+    if (!PacketAlertCheck(p, 1)) {
         SCLogInfo("could not match on sig 1 with when fast_pattern is inspecting payload");
         goto end;
     }