sbsiglist: check for owner and type arguments
..rather than segfaulting. Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
parent
541beab7ce
commit
030d5ef321
1 changed files with 12 additions and 0 deletions
|
@ -242,6 +242,18 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
ctx->infilename = argv[optind];
|
ctx->infilename = argv[optind];
|
||||||
|
|
||||||
|
if (!type_str) {
|
||||||
|
fprintf(stderr, "No type specified\n");
|
||||||
|
usage();
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!type_str) {
|
||||||
|
fprintf(stderr, "No owner specified\n");
|
||||||
|
usage();
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
ctx->type = parse_type(type_str);
|
ctx->type = parse_type(type_str);
|
||||||
if (!ctx->type) {
|
if (!ctx->type) {
|
||||||
fprintf(stderr, "Invalid type '%s'\n", type_str);
|
fprintf(stderr, "Invalid type '%s'\n", type_str);
|
||||||
|
|
Loading…
Reference in a new issue