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:
Garance A Drosehn 2012-04-30 00:54:10 +00:00
parent c11c655c32
commit aa318fd726

View File

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