From 238960af7ec96db8eb6f764ac587817cf2d1f65b Mon Sep 17 00:00:00 2001 From: dsl Date: Fri, 29 Oct 2004 19:51:36 +0000 Subject: [PATCH] Add (unsigned char) cast to ctype function --- bin/chio/chio.c | 6 +++--- bin/ps/ps.c | 8 ++++---- bin/systrace/policy.c | 8 ++++---- bin/systrace/util.c | 6 +++--- dist/bind/lib/dns/rdata/in_1/wks_11.c | 4 ++-- dist/bind/lib/isc/string.c | 4 ++-- usr.sbin/altq/libaltq/parser.c | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/bin/chio/chio.c b/bin/chio/chio.c index f5518429b49a..9821fb7f0dfd 100644 --- a/bin/chio/chio.c +++ b/bin/chio/chio.c @@ -1,4 +1,4 @@ -/* $NetBSD: chio.c,v 1.25 2004/06/25 14:27:57 wiz Exp $ */ +/* $NetBSD: chio.c,v 1.26 2004/10/29 19:51:36 dsl Exp $ */ /*- * Copyright (c) 1996, 1998, 1999 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ __COPYRIGHT( "@(#) Copyright (c) 1996, 1998, 1999\ The NetBSD Foundation, Inc. All rights reserved."); -__RCSID("$NetBSD: chio.c,v 1.25 2004/06/25 14:27:57 wiz Exp $"); +__RCSID("$NetBSD: chio.c,v 1.26 2004/10/29 19:51:36 dsl Exp $"); #endif #include @@ -545,7 +545,7 @@ do_status(const char *cname, int argc, char **argv) * If we get an element type, we can't have specified * anything else. */ - if (isdigit(*argv[0]) == 0) { + if (isdigit((unsigned char)*argv[0]) == 0) { if (schet == echet || flags != 0 || have_unit || have_ucount) { warnx("%s: malformed command line", cname); diff --git a/bin/ps/ps.c b/bin/ps/ps.c index 66e82bc4a5d3..0e3c4167f9f4 100644 --- a/bin/ps/ps.c +++ b/bin/ps/ps.c @@ -1,4 +1,4 @@ -/* $NetBSD: ps.c,v 1.54 2004/03/27 14:09:10 simonb Exp $ */ +/* $NetBSD: ps.c,v 1.55 2004/10/29 19:53:29 dsl Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -75,7 +75,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: ps.c,v 1.54 2004/03/27 14:09:10 simonb Exp $"); +__RCSID("$NetBSD: ps.c,v 1.55 2004/10/29 19:53:29 dsl Exp $"); #endif #endif /* not lint */ @@ -698,7 +698,7 @@ kludge_oldps_options(char *s) * otherwise check for trailing number, which *may* be a * pid. */ - while (cp >= s && isdigit(*cp)) + while (cp >= s && isdigit((unsigned char)*cp)) --cp; } cp++; @@ -708,7 +708,7 @@ kludge_oldps_options(char *s) * if there's a trailing number, and not a preceding 'p' (pid) or * 't' (tty) flag, then assume it's a pid and insert a 'p' flag. */ - if (isdigit(*cp) && + if (isdigit((unsigned char)*cp) && (cp == s || (cp[-1] != 'U' && cp[-1] != 't' && cp[-1] != 'p' && (cp - 1 == s || cp[-2] != 't')))) *ns++ = 'p'; diff --git a/bin/systrace/policy.c b/bin/systrace/policy.c index 7820362d3313..19c8efbba7e2 100644 --- a/bin/systrace/policy.c +++ b/bin/systrace/policy.c @@ -1,4 +1,4 @@ -/* $NetBSD: policy.c,v 1.15 2003/08/01 05:42:48 provos Exp $ */ +/* $NetBSD: policy.c,v 1.16 2004/10/29 19:55:43 dsl Exp $ */ /* $OpenBSD: policy.c,v 1.15 2002/08/07 00:34:17 vincent Exp $ */ /* * Copyright 2002 Niels Provos @@ -30,7 +30,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: policy.c,v 1.15 2003/08/01 05:42:48 provos Exp $"); +__RCSID("$NetBSD: policy.c,v 1.16 2004/10/29 19:55:43 dsl Exp $"); #include #include @@ -313,7 +313,7 @@ systrace_policyfilename(char *dirname, const char *name) p = name; while (*p) { - if (!isalnum(*p)) { + if (!isalnum((unsigned char)*p)) { if (i != plen) file[i++] = '_'; } else @@ -526,7 +526,7 @@ systrace_policyline(char *line) /* Remove trailing white space */ p = line + strlen(line) - 1; while (p > line) { - if (!isspace(*p)) + if (!isspace((unsigned char)*p)) break; *p-- = '\0'; } diff --git a/bin/systrace/util.c b/bin/systrace/util.c index 1e0b772e2a7c..c68368a5e288 100644 --- a/bin/systrace/util.c +++ b/bin/systrace/util.c @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.5 2003/08/01 06:15:02 provos Exp $ */ +/* $NetBSD: util.c,v 1.6 2004/10/29 19:55:43 dsl Exp $ */ /* $OpenBSD: util.c,v 1.8 2002/07/19 14:38:58 itojun Exp $ */ /* * Copyright 2002 Niels Provos @@ -30,7 +30,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: util.c,v 1.5 2003/08/01 06:15:02 provos Exp $"); +__RCSID("$NetBSD: util.c,v 1.6 2004/10/29 19:55:43 dsl Exp $"); #include #include @@ -83,7 +83,7 @@ strrpl(char *str, size_t size, char *match, char *value) /* Try to match against the variable */ while ((p = strchr(p, match[0])) != NULL) { - if (!strncmp(p, match, len) && !isalnum(p[len])) + if (!strncmp(p, match, len) && !isalnum((unsigned char)p[len])) break; p += len; diff --git a/dist/bind/lib/dns/rdata/in_1/wks_11.c b/dist/bind/lib/dns/rdata/in_1/wks_11.c index 6c764cc6b027..d2e625c9204a 100644 --- a/dist/bind/lib/dns/rdata/in_1/wks_11.c +++ b/dist/bind/lib/dns/rdata/in_1/wks_11.c @@ -1,4 +1,4 @@ -/* $NetBSD: wks_11.c,v 1.1.1.1 2004/05/17 23:45:00 christos Exp $ */ +/* $NetBSD: wks_11.c,v 1.2 2004/10/29 20:21:15 dsl Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -109,7 +109,7 @@ fromtext_in_wks(ARGS_FROMTEXT) { service[sizeof(service)-1] = '\0'; for (i = strlen(service) - 1; i >= 0; i--) if (isupper(service[i]&0xff)) - service[i] = tolower(service[i]); + service[i] = tolower((unsigned char)service[i]); port = strtol(DNS_AS_STR(token), &e, 10); if (*e == 0) diff --git a/dist/bind/lib/isc/string.c b/dist/bind/lib/isc/string.c index 4a5eacb295c7..5caa7d128851 100644 --- a/dist/bind/lib/isc/string.c +++ b/dist/bind/lib/isc/string.c @@ -1,4 +1,4 @@ -/* $NetBSD: string.c,v 1.1.1.1 2004/05/17 23:45:03 christos Exp $ */ +/* $NetBSD: string.c,v 1.2 2004/10/29 20:26:45 dsl Exp $ */ /* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") @@ -62,7 +62,7 @@ isc_string_touint64(char *source, char **end, int base) { tmp = 0; while ((c = *s) != 0) { - c = tolower(c); + c = tolower((unsigned char)c); /* end ? */ if ((o = strchr(digits, c)) == NULL) { *end = s; diff --git a/usr.sbin/altq/libaltq/parser.c b/usr.sbin/altq/libaltq/parser.c index ac235aec6ea3..42995f861aff 100644 --- a/usr.sbin/altq/libaltq/parser.c +++ b/usr.sbin/altq/libaltq/parser.c @@ -1,4 +1,4 @@ -/* $NetBSD: parser.c,v 1.9 2003/02/01 17:13:14 wiz Exp $ */ +/* $NetBSD: parser.c,v 1.10 2004/10/29 19:58:18 dsl Exp $ */ /* $KAME: parser.c,v 1.16 2002/02/20 10:40:39 kjc Exp $ */ /* * Copyright (C) 1999-2002 @@ -401,7 +401,7 @@ get_port(const char *name, u_int16_t *port_no) struct servent *s; u_int16_t num; - if (isdigit(name[0])) { + if (isdigit((unsigned char)name[0])) { num = (u_int16_t)strtol(name, NULL, 0); *port_no = htons(num); return (1); @@ -419,7 +419,7 @@ get_proto(const char *name, int *proto_no) { struct protoent *p; - if (isdigit(name[0])) { + if (isdigit((unsigned char)name[0])) { *proto_no = (int)strtol(name, NULL, 0); return (1); }