diff options
author | stefanf <stefanf@FreeBSD.org> | 2004-06-08 12:11:19 +0000 |
---|---|---|
committer | stefanf <stefanf@FreeBSD.org> | 2004-06-08 12:11:19 +0000 |
commit | 95e7f6997b0f4feb7edba4d8ee6558487e14129c (patch) | |
tree | 04e59773e438e3d706b1b69c8bd6ecfe4bb72741 | |
parent | 76718df1361bca784930346191f487743e6558a2 (diff) | |
download | FreeBSD-src-95e7f6997b0f4feb7edba4d8ee6558487e14129c.zip FreeBSD-src-95e7f6997b0f4feb7edba4d8ee6558487e14129c.tar.gz |
- 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)
-rw-r--r-- | usr.sbin/bootparamd/bootparamd/main.c | 5 |
1 files changed, 2 insertions, 3 deletions
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': |