diff options
author | Harald Welte <laforge@osmocom.org> | 2019-12-03 21:38:39 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2019-12-17 15:02:28 +0100 |
commit | 6e054bf66112689306243a1eb6ef6ef45a49c6bd (patch) | |
tree | d4e49b74c1f34b88280847b1debf92c7969d3737 | |
parent | a8a646af169d758eb0e49675c9dc247bbb642938 (diff) |
stp: exit(2) on unsupported positional arguments on command line
Change-Id: I70390948943fe42469b8c6d63babc232e857e60c
-rw-r--r-- | stp/stp_main.c | 5 |
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) |