Add a sensible message if an invalid ID was entered

PR:		8739
Submitted by:	Love lha@stacken.kth.se
Reviewed by:	Doug Rabson <doug@freebsd.org>
This commit is contained in:
Nick Hibma 1999-07-25 11:00:05 +00:00
parent eda5a3370a
commit 7d83305d4e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49079

View File

@ -26,7 +26,7 @@
#ifndef lint #ifndef lint
static const char rcsid[] = static const char rcsid[] =
"$Id: kldunload.c,v 1.6 1998/07/06 06:59:52 charnier Exp $"; "$Id: kldunload.c,v 1.7 1998/11/07 00:42:52 des Exp $";
#endif /* not lint */ #endif /* not lint */
#include <err.h> #include <err.h>
@ -56,6 +56,8 @@ main(int argc, char** argv)
switch (c) { switch (c) {
case 'i': case 'i':
fileid = atoi(optarg); fileid = atoi(optarg);
if (!fileid)
errx(1, "Invalid ID %s", optarg);
break; break;
case 'n': case 'n':
filename = optarg; filename = optarg;