From 95e7f6997b0f4feb7edba4d8ee6558487e14129c Mon Sep 17 00:00:00 2001 From: stefanf Date: Tue, 8 Jun 2004 12:11:19 +0000 Subject: - Don't use argv[i] when i is uninitialised. - Cast isdigit's argument to unsigned char. - Remove the now unused variable i. Approved by: das (mentor) --- usr.sbin/bootparamd/bootparamd/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.sbin/bootparamd/bootparamd') diff --git a/usr.sbin/bootparamd/bootparamd/main.c b/usr.sbin/bootparamd/bootparamd/main.c index a3cc0e7..4468232 100644 --- a/usr.sbin/bootparamd/bootparamd/main.c +++ b/usr.sbin/bootparamd/bootparamd/main.c @@ -45,7 +45,6 @@ int argc; char **argv; { SVCXPRT *transp; - int i; struct hostent *he; struct stat buf; char c; @@ -56,7 +55,7 @@ char **argv; debug = 1; break; case 'r': - if ( isdigit( *optarg)) { + if (isdigit((unsigned char)*optarg)) { route_addr = inet_addr(optarg); break; } else { @@ -65,7 +64,7 @@ char **argv; bcopy(he->h_addr, (char *)&route_addr, sizeof(route_addr)); break; } else { - errx(1, "no such host %s", argv[i]); + errx(1, "no such host %s", optarg); } } case 'f': -- cgit v1.1