aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2019-12-03 21:38:39 +0100
committerHarald Welte <laforge@osmocom.org>2019-12-17 15:02:28 +0100
commit6e054bf66112689306243a1eb6ef6ef45a49c6bd (patch)
treed4e49b74c1f34b88280847b1debf92c7969d3737
parenta8a646af169d758eb0e49675c9dc247bbb642938 (diff)
stp: exit(2) on unsupported positional arguments on command line
-rw-r--r--stp/stp_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stp/stp_main.c b/stp/stp_main.c
index 3923ed2..19420c0 100644
--- a/stp/stp_main.c
+++ b/stp/stp_main.c
@@ -127,6 +127,11 @@ static void handle_options(int argc, char **argv)
break;
}
}
+
+ if (argc > optind) {
+ fprintf(stderr, "Unsupported positional arguments in command line\n");
+ exit(2);
+ }
}
static void signal_handler(int signal)