]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/noalert: minor cleanup
authorVictor Julien <vjulien@oisf.net>
Fri, 12 Jan 2024 08:51:02 +0000 (09:51 +0100)
committerVictor Julien <vjulien@oisf.net>
Fri, 7 Jun 2024 18:54:05 +0000 (20:54 +0200)
src/detect-noalert.c

index dda060a4f0694dec190b3ea7ab6ba25805a4edc6..fce16875e455b00dd598895a7833025e40f4b1f9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2010 Open Information Security Foundation
+/* Copyright (C) 2007-2024 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
 #include "detect.h"
 #include "detect-noalert.h"
 #include "util-debug.h"
+#include "util-validate.h"
 
-static int DetectNoalertSetup (DetectEngineCtx *, Signature *, const char *);
+static int DetectNoalertSetup(DetectEngineCtx *de_ctx, Signature *s, const char *nullstr)
+{
+    DEBUG_VALIDATE_BUG_ON(nullstr != NULL);
+
+    s->flags |= SIG_FLAG_NOALERT;
+    return 0;
+}
 
-void DetectNoalertRegister (void)
+void DetectNoalertRegister(void)
 {
     sigmatch_table[DETECT_NOALERT].name = "noalert";
     sigmatch_table[DETECT_NOALERT].desc = "no alert will be generated by the rule";
@@ -38,15 +45,3 @@ void DetectNoalertRegister (void)
     sigmatch_table[DETECT_NOALERT].Setup = DetectNoalertSetup;
     sigmatch_table[DETECT_NOALERT].flags |= SIGMATCH_NOOPT;
 }
-
-static int DetectNoalertSetup (DetectEngineCtx *de_ctx, Signature *s, const char *nullstr)
-{
-    if (nullstr != NULL) {
-        SCLogError("nocase has no value");
-        return -1;
-    }
-
-    s->flags |= SIG_FLAG_NOALERT;
-    return 0;
-}
-