From f7571bacc24121fd51f4e8cfeb6f23619d298322 Mon Sep 17 00:00:00 2001 From: dsl Date: Sat, 30 Oct 2004 08:46:12 +0000 Subject: [PATCH] Add (unsigned char) cast to ctype functions --- usr.sbin/map-mbone/mapper.c | 6 +++--- usr.sbin/mlxctl/dklist.c | 6 +++--- usr.sbin/mountd/mountd.c | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/usr.sbin/map-mbone/mapper.c b/usr.sbin/map-mbone/mapper.c index 8e706614c139..2d99414ba7bc 100644 --- a/usr.sbin/map-mbone/mapper.c +++ b/usr.sbin/map-mbone/mapper.c @@ -1,4 +1,4 @@ -/* $NetBSD: mapper.c,v 1.21 2004/01/05 23:23:38 jmmv Exp $ */ +/* $NetBSD: mapper.c,v 1.22 2004/10/30 08:46:12 dsl Exp $ */ /* Mapper for connections between MRouteD multicast routers. * Written by Pavel Curtis @@ -768,7 +768,7 @@ void graph_map(void) int get_number(int *var, int deflt, char ***pargv, int *pargc) { if ((*pargv)[0][2] == '\0') { /* Get the value from the next argument */ - if (*pargc > 1 && isdigit((*pargv)[1][0])) { + if (*pargc > 1 && isdigit((unsigned char)(*pargv)[1][0])) { (*pargv)++, (*pargc)--; *var = atoi((*pargv)[0]); return 1; @@ -778,7 +778,7 @@ int get_number(int *var, int deflt, char ***pargv, int *pargc) } else return 0; } else { /* Get value from the rest of this argument */ - if (isdigit((*pargv)[0][2])) { + if (isdigit((unsigned char)(*pargv)[0][2])) { *var = atoi((*pargv)[0] + 2); return 1; } else { diff --git a/usr.sbin/mlxctl/dklist.c b/usr.sbin/mlxctl/dklist.c index 92d9179ba4d0..82f427323a23 100644 --- a/usr.sbin/mlxctl/dklist.c +++ b/usr.sbin/mlxctl/dklist.c @@ -1,4 +1,4 @@ -/* $NetBSD: dklist.c,v 1.4 2002/06/01 23:51:06 lukem Exp $ */ +/* $NetBSD: dklist.c,v 1.5 2004/10/30 08:47:58 dsl Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ #ifndef lint #include -__RCSID("$NetBSD: dklist.c,v 1.4 2002/06/01 23:51:06 lukem Exp $"); +__RCSID("$NetBSD: dklist.c,v 1.5 2004/10/30 08:47:58 dsl Exp $"); #endif /* not lint */ #include @@ -146,7 +146,7 @@ mlx_disk_add0(const char *name) struct mlx_disk *md; int unit; - if (name[0] != 'l' || name[1] != 'd' || !isdigit(name[2])) + if (name[0] != 'l' || name[1] != 'd' || !isdigit((unsigned char)name[2])) return (-1); SIMPLEQ_FOREACH(md, &mlx_disks, chain) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index e162a79f5fc0..56edca290cda 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $NetBSD: mountd.c,v 1.87 2004/04/21 01:05:48 christos Exp $ */ +/* $NetBSD: mountd.c,v 1.88 2004/10/30 08:49:45 dsl Exp $ */ /* * Copyright (c) 1989, 1993 @@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; #else -__RCSID("$NetBSD: mountd.c,v 1.87 2004/04/21 01:05:48 christos Exp $"); +__RCSID("$NetBSD: mountd.c,v 1.88 2004/10/30 08:49:45 dsl Exp $"); #endif #endif /* not lint */ @@ -2172,7 +2172,7 @@ get_net(cp, net, maskflg) sin.sin_len = sizeof sin; sin.sin_addr = inet_makeaddr(np->n_net, 0); sa = (struct sockaddr *)&sin; - } else if (isdigit(*cp)) { + } else if (isdigit((unsigned char)*cp)) { memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_flags = AI_NUMERICHOST; @@ -2190,7 +2190,7 @@ get_net(cp, net, maskflg) sa = (struct sockaddr *)&sin; } else sa = ai->ai_addr; - } else if (isxdigit(*cp) || *cp == ':') { + } else if (isxdigit((unsigned char)*cp) || *cp == ':') { memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_flags = AI_NUMERICHOST; @@ -2308,7 +2308,7 @@ parsecred(namelist, cr) */ names = strsep(&namelist, " \t\n"); name = strsep(&names, ":"); - if (isdigit(*name) || *name == '-') + if (isdigit((unsigned char)*name) || *name == '-') pw = getpwuid(atoi(name)); else pw = getpwnam(name); @@ -2339,7 +2339,7 @@ parsecred(namelist, cr) */ if (pw != NULL) cr->cr_uid = pw->pw_uid; - else if (isdigit(*name) || *name == '-') + else if (isdigit((unsigned char)*name) || *name == '-') cr->cr_uid = atoi(name); else { syslog(LOG_ERR, "Unknown user: %s", name); @@ -2348,7 +2348,7 @@ parsecred(namelist, cr) cr->cr_ngroups = 0; while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS) { name = strsep(&names, ":"); - if (isdigit(*name) || *name == '-') { + if (isdigit((unsigned char)*name) || *name == '-') { cr->cr_groups[cr->cr_ngroups++] = atoi(name); } else { if ((gr = getgrnam(name)) == NULL) {