summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-events.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2013-07-16 21:55:15 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-12-30 23:50:37 +0100
commit1c73b54e826ffd28e94987b6ced51c4049661793 (patch)
treea559657f2c9086ce8c4f8a2510a416aa5ee911a9 /iptables/xtables-events.c
parente9a0ef8f1e27f5ef13a27f6cc984e8f2e05afd72 (diff)
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 <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables-events.c')
-rw-r--r--iptables/xtables-events.c4
1 files changed, 4 insertions, 0 deletions
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);
}
}