stp: exit(2) on unsupported positional arguments on command line

Change-Id: I70390948943fe42469b8c6d63babc232e857e60c
This commit is contained in:
Harald Welte 2019-12-03 21:38:39 +01:00
parent a8a646af16
commit 6e054bf661
1 changed files with 5 additions and 0 deletions

View File

@ -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)