mirror of https://gerrit.osmocom.org/libosmocore
utils: exit(2) on unsupported positional arguments on command line
Change-Id: Icc76cae2225ec4e664b950176dd861fa15712f59
This commit is contained in:
parent
f7404bb473
commit
278a6c8fcf
|
@ -128,6 +128,11 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argc > optind) {
|
||||||
|
fprintf(stderr, "Unsupported positional arguments in command line\n");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case MODE_NONE:
|
case MODE_NONE:
|
||||||
help(argv[0]);
|
help(argv[0]);
|
||||||
|
|
|
@ -247,6 +247,11 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argc > optind) {
|
||||||
|
fprintf(stderr, "Unsupported positional arguments in command line\n");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
|
||||||
if (!rand_is_set) {
|
if (!rand_is_set) {
|
||||||
rc = osmo_get_rand_id(_rand, 16);
|
rc = osmo_get_rand_id(_rand, 16);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
|
Loading…
Reference in New Issue