From 1c73b54e826ffd28e94987b6ced51c4049661793 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 16 Jul 2013 21:55:15 +0200 Subject: xtables-events: print usage on wrong arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- iptables/xtables-events.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'iptables') 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); } } -- cgit v1.2.3