From: Pablo Neira Ayuso Date: Tue, 16 Jul 2013 19:55:15 +0000 (+0200) Subject: xtables-events: print usage on wrong arguments X-Git-Tag: v1.6.0~111^2~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c73b54e826ffd28e94987b6ced51c4049661793;p=thirdparty%2Fiptables.git xtables-events: print usage on wrong arguments Set opterr to zero to skip getopt_long error reporting. This also fixes the following compilation warning: xtables-events.c:148:13: warning: ‘print_usage’ defined but not used [-Wunused-function] Signed-off-by: Pablo Neira Ayuso --- diff --git a/iptables/xtables-events.c b/iptables/xtables-events.c index 2600a250..d4542f0b 100644 --- a/iptables/xtables-events.c +++ b/iptables/xtables-events.c @@ -172,11 +172,15 @@ int xtables_events_main(int argc, char *argv[]) init_extensions4(); #endif + opterr = 0; while ((c = getopt_long(argc, argv, "c", options, NULL)) != -1) { switch (c) { case 'c': counters = true; break; + default: + print_usage(argv[0], XTABLES_VERSION); + exit(EXIT_FAILURE); } }