From 913804341edd723e753715d6f68a31c88668a556 Mon Sep 17 00:00:00 2001 From: Petr Vaganov Date: Mon, 10 Mar 2025 16:41:42 +0500 Subject: [PATCH] ipfw: the correct reset getopt in main --- ipfw/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ipfw/main.c b/ipfw/main.c index a8f5fed..e74c694 100644 --- a/ipfw/main.c +++ b/ipfw/main.c @@ -261,7 +261,9 @@ ipfw_main(int oldac, char **oldav) /* Save arguments for final freeing of memory. */ save_av = av; - optind = optreset = 1; /* restart getopt() */ + /* restart getopt() */ + optreset = 1; + optind = 0; while ((ch = getopt(ac, av, "abcdefhinNp:qs:STtv")) != -1) switch (ch) { case 'a':