]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
pfring: fix compile warning 5234/head
authorVictor Julien <victor@inliniac.net>
Mon, 27 Jul 2020 08:16:29 +0000 (10:16 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 28 Jul 2020 09:34:32 +0000 (11:34 +0200)
src/runmode-pfring.c

index e0e52a5c8160bd9fe4bd13a49335ed1d7fd9ea5d..528d850760f0d988a5f662189299bc65ce7ec37d 100644 (file)
@@ -264,10 +264,13 @@ static void *ParsePfringConfig(const char *iface)
                 }
             }
         } else {
-            if (StringParseUint16(&pfconf->threads, 10, 0, (const char *)threadsstr) < 0) {
+            uint16_t threads = 0;
+            if (StringParseUint16(&threads, 10, 0, (const char *)threadsstr) < 0) {
                 SCLogWarning(SC_ERR_INVALID_VALUE, "Invalid value for "
                              "pfring.threads: '%s'. Resetting to 1.", threadsstr);
                 pfconf->threads = 1;
+            } else {
+                pfconf->threads = threads;
             }
         }
     }