Add (unsigned char) cast to ctype functions

This commit is contained in:
dsl 2004-10-30 08:46:12 +00:00
parent 75ba9fc767
commit f7571bacc2
3 changed files with 13 additions and 13 deletions

View File

@ -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 <Pavel@PARC.Xerox.Com>
@ -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 {

View File

@ -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 <sys/cdefs.h>
__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 <sys/types.h>
@ -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)

View File

@ -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) {