Date: 24 Jul 1999 13:52:00 +0200 From: Love <lha@e.kth.se> To: n_hibma@FreeBSD.org Cc: freebsd-bugs@FreeBSD.org Subject: Re: bin/873: atoi and modunload Message-ID: <am4siuqn8f.fsf@hummel.e.kth.se> In-Reply-To: n_hibma@FreeBSD.org's message of Sat, 24 Jul 1999 04:35:14 -0700 (PDT) References: <199907241135.EAA36699@freefall.freebsd.org>
index | next in thread | previous in thread | raw e-mail
n_hibma@FreeBSD.org writes:
> Synopsis: atoi and modunload
>
> State-Changed-From-To: open->closed
> State-Changed-By: n_hibma
> State-Changed-When: Sat Jul 24 04:34:06 PDT 1999
> State-Changed-Why:
> kldload (replacement of modunload) shows usage() when a number
> smaller then 1 or not a number is entered.
This time its not fatal but couldn't you fix so kldunload.c would accully
give a sane error message when the user did wrong, please ?
Love
--- kldunload.c.orig Sat Jul 24 13:46:27 1999
+++ kldunload.c Sat Jul 24 13:49:45 1999
@@ -51,11 +51,14 @@
int verbose = 0;
int fileid = 0;
char* filename = 0;
+ char *endptr;
while ((c = getopt(argc, argv, "i:n:v")) != -1)
switch (c) {
case 'i':
- fileid = atoi(optarg);
+ fileid = strtol(optarg, &endptr, 0);
+ if (*endptr != '\0')
+ errx(1, "not a valid number");
break;
case 'n':
filename = optarg;
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?am4siuqn8f.fsf>
