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