Add (unsigned char) cast to ctype functions

This commit is contained in:
dsl 2004-10-30 15:39:39 +00:00
parent c4670c4ec7
commit 9122339b9f
7 changed files with 21 additions and 20 deletions

View File

@ -37,7 +37,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)rwhod.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: rwhod.c,v 1.22 2003/08/07 11:25:43 agc Exp $");
__RCSID("$NetBSD: rwhod.c,v 1.23 2004/10/30 15:39:39 dsl Exp $");
#endif
#endif /* not lint */
@ -252,7 +252,8 @@ verify(name)
int size = 0;
while (*name) {
if (!isascii(*name) || !(isalnum(*name) || ispunct(*name)))
if (!isascii(*name) || !(isalnum((unsigned char)*name) ||
ispunct((unsigned char)*name)))
return (0);
name++, size++;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.19 2004/02/13 11:36:24 wiz Exp $ */
/* $NetBSD: main.c,v 1.20 2004/10/30 15:40:57 dsl Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -39,7 +39,7 @@
__COPYRIGHT("@(#) Copyright (c) 1994 Christopher G. Demetriou\n\
All rights reserved.\n");
__RCSID("$NetBSD: main.c,v 1.19 2004/02/13 11:36:24 wiz Exp $");
__RCSID("$NetBSD: main.c,v 1.20 2004/10/30 15:40:57 dsl Exp $");
#endif
/*
@ -338,7 +338,7 @@ acct_load(pn, wr)
i++) {
char c = ac.ac_comm[i];
if (!isascii(c) || iscntrl(c)) {
if (!isascii(c) || iscntrl((unsigned char)c)) {
ci.ci_comm[i] = '?';
ci.ci_flags |= CI_UNPRINTABLE;
} else

View File

@ -1,4 +1,4 @@
/* $NetBSD: screenblank.c,v 1.20 2004/01/05 23:23:39 jmmv Exp $ */
/* $NetBSD: screenblank.c,v 1.21 2004/10/30 15:43:25 dsl Exp $ */
/*-
* Copyright (c) 1996-2002 The NetBSD Foundation, Inc.
@ -45,7 +45,7 @@
__COPYRIGHT(
"@(#) Copyright (c) 1996-2002 \
The NetBSD Foundation, Inc. All rights reserved.");
__RCSID("$NetBSD: screenblank.c,v 1.20 2004/01/05 23:23:39 jmmv Exp $");
__RCSID("$NetBSD: screenblank.c,v 1.21 2004/10/30 15:43:25 dsl Exp $");
#endif
#include <sys/types.h>
@ -367,7 +367,7 @@ cvt_arg(char *arg, struct timespec *tvp)
continue;
}
if (!isdigit(*cp))
if (!isdigit((unsigned char)*cp))
errx(1, "Invalid argument: %s", arg);
if (period) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: sliplogin.c,v 1.20 2003/10/21 02:53:57 fvdl Exp $ */
/* $NetBSD: sliplogin.c,v 1.21 2004/10/30 15:44:04 dsl Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993\n\
#if 0
static char sccsid[] = "@(#)sliplogin.c 8.2 (Berkeley) 2/1/94";
#else
__RCSID("$NetBSD: sliplogin.c,v 1.20 2003/10/21 02:53:57 fvdl Exp $");
__RCSID("$NetBSD: sliplogin.c,v 1.21 2004/10/30 15:44:04 dsl Exp $");
#endif
#endif /* not lint */
@ -135,7 +135,7 @@ findid(name)
n = sscanf(loginargs, "%15s%*[ \t]%15s%*[ \t]%15s%*[ \t]%15s%*[ \t]%15s%*[ \t]%15s%*[ \t]%15s%*[ \t]%15s%*[ \t]%15s\n",
user, laddr, raddr, mask, slopt[0], slopt[1],
slopt[2], slopt[3], slopt[4]);
if (user[0] == '#' || isspace(user[0]))
if (user[0] == '#' || isspace((unsigned char)user[0]))
continue;
if (strcmp(user, name) != 0)
continue;

View File

@ -1,4 +1,4 @@
/* $NetBSD: slstats.c,v 1.14 2002/06/18 22:32:16 itojun Exp $ */
/* $NetBSD: slstats.c,v 1.15 2004/10/30 15:44:39 dsl Exp $ */
/*
* print serial line IP statistics:
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: slstats.c,v 1.14 2002/06/18 22:32:16 itojun Exp $");
__RCSID("$NetBSD: slstats.c,v 1.15 2004/10/30 15:44:39 dsl Exp $");
#endif
#define INET
@ -131,7 +131,7 @@ main(argc, argv)
usage();
while (argc--) {
if (isdigit(*argv[0])) {
if (isdigit((unsigned char)*argv[0])) {
unit = atoi(*argv);
if (unit < 0)
usage();

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunlabel.c,v 1.15 2004/01/05 23:23:39 jmmv Exp $ */
/* $NetBSD: sunlabel.c,v 1.16 2004/10/30 15:46:31 dsl Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: sunlabel.c,v 1.15 2004/01/05 23:23:39 jmmv Exp $");
__RCSID("$NetBSD: sunlabel.c,v 1.16 2004/10/30 15:46:31 dsl Exp $");
#endif
#include <stdio.h>
@ -661,7 +661,7 @@ scannum(const char **cpp, uint32_t *np, const char *tag)
nd = 0;
cp = *cpp;
while (*cp && isdigit(*cp)) {
while (*cp && isdigit((unsigned char)*cp)) {
v = (10 * v) + (*cp++ - '0');
nd++;
}
@ -892,7 +892,7 @@ chvalue(const char *str)
}
skipspaces(&str);
cp = str;
while (*cp && !isspace(*cp))
while (*cp && !isspace((unsigned char)*cp))
cp++;
n = cp - str;
for (i = 0; fields[i].tag; i++) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: expand.c,v 1.14 2002/07/10 20:19:39 wiz Exp $ */
/* $NetBSD: expand.c,v 1.15 2004/10/30 15:48:20 dsl Exp $ */
/*
* Copyright (c) 1991 Carnegie Mellon University
@ -125,7 +125,7 @@ glob(char *as)
if (*cs == '~' && pathp == path) {
if (addpath('~'))
goto endit;
for (cs++; isalnum(*cs) || *cs == '_' || *cs == '-';)
for (cs++; isalnum((unsigned char)*cs) || *cs == '_' || *cs == '-';)
if (addpath(*cs++))
goto endit;
if (!*cs || *cs == '/') {