Message ID | 20210129212452.45352-2-mikhail.sennikovskii@cloud.ionos.com |
---|---|
State | Under Review |
Delegated to: | Pablo Neira |
Headers | show |
Series | conntrack: save output format | expand |
diff --git a/src/conntrack.c b/src/conntrack.c index 987d936..c582d86 100644 --- a/src/conntrack.c +++ b/src/conntrack.c @@ -2798,6 +2798,8 @@ static void do_parse(struct ct_cmd *ct_cmd, int argc, char *argv[]) /* disable explicit missing arguments error output from getopt_long */ opterr = 0; + /* reset optind, for the case do_parse is called multiple times */ + optind = 0; while ((c = getopt_long(argc, argv, getopt_str, opts, NULL)) != -1) { switch(c) {
As a multicommand support preparation reset optind for the case do_parse is called multiple times Signed-off-by: Mikhail Sennikovsky <mikhail.sennikovskii@cloud.ionos.com> --- src/conntrack.c | 2 ++ 1 file changed, 2 insertions(+)