Catch the user-error when no queue name was specified on an
lpc-command which supports '-msg' (e.g.: setstatus). Print out a helpful error message instead hitting a seg-fault. MFC after: 3 weeks
This commit is contained in:
parent
c11c655c32
commit
aa318fd726
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=234824
@ -163,6 +163,14 @@ generic(void (*specificrtn)(struct printer *_pp), int cmdopts,
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (argc < 1) {
|
||||
printf("error: No printer name(s) specified before"
|
||||
" '-msg'.\n");
|
||||
printf("usage: %s {all | printer ...}",
|
||||
generic_cmdname);
|
||||
printf(" [-msg <text> ...]\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* call initialization routine, if there is one for this cmd */
|
||||
|
Loading…
Reference in New Issue
Block a user