exit(2) on unsupported positional arguments on command line
Change-Id: I6d4efa6ddef41607aecd5ceee78e400db821292f
This commit is contained in:
parent
50595fb9b5
commit
cbf23b6465
|
@ -123,6 +123,11 @@ static void handle_options(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argc > optind) {
|
||||||
|
fprintf(stderr, "Unsupported positional arguments on command line\n");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
|
|
@ -275,6 +275,11 @@ int main(int argc, char **argv)
|
||||||
exit(2);
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (argc > optind+1) {
|
||||||
|
fprintf(stderr, "Unsupported positional arguments on command line\n");
|
||||||
|
exit(2);
|
||||||
|
}
|
||||||
|
|
||||||
f = osmo_e1cap_open(NULL, argv[optind++]);
|
f = osmo_e1cap_open(NULL, argv[optind++]);
|
||||||
if (!f) {
|
if (!f) {
|
||||||
fprintf(stderr, "Unable to open input file\n");
|
fprintf(stderr, "Unable to open input file\n");
|
||||||
|
|
Loading…
Reference in New Issue