Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin Add (unsigned char) cast to ctype functions
details: https://anonhg.NetBSD.org/src/rev/62a0e308755e
branches: trunk
changeset: 570831:62a0e308755e
user: dsl <dsl%NetBSD.org@localhost>
date: Sat Oct 30 15:39:39 2004 +0000
description:
Add (unsigned char) cast to ctype functions
diffstat:
usr.sbin/rwhod/rwhod.c | 5 +++--
usr.sbin/sa/main.c | 6 +++---
usr.sbin/screenblank/screenblank.c | 6 +++---
usr.sbin/sliplogin/sliplogin.c | 6 +++---
usr.sbin/slstats/slstats.c | 6 +++---
usr.sbin/sunlabel/sunlabel.c | 8 ++++----
usr.sbin/sup/source/expand.c | 4 ++--
7 files changed, 21 insertions(+), 20 deletions(-)
diffs (184 lines):
diff -r b0e4adb59c26 -r 62a0e308755e usr.sbin/rwhod/rwhod.c
--- a/usr.sbin/rwhod/rwhod.c Sat Oct 30 15:28:45 2004 +0000
+++ b/usr.sbin/rwhod/rwhod.c Sat Oct 30 15:39:39 2004 +0000
@@ -37,7 +37,7 @@
#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 @@
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++;
}
diff -r b0e4adb59c26 -r 62a0e308755e usr.sbin/sa/main.c
--- a/usr.sbin/sa/main.c Sat Oct 30 15:28:45 2004 +0000
+++ b/usr.sbin/sa/main.c Sat Oct 30 15:39:39 2004 +0000
@@ -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 @@
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
diff -r b0e4adb59c26 -r 62a0e308755e usr.sbin/screenblank/screenblank.c
--- a/usr.sbin/screenblank/screenblank.c Sat Oct 30 15:28:45 2004 +0000
+++ b/usr.sbin/screenblank/screenblank.c Sat Oct 30 15:39:39 2004 +0000
@@ -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 @@
continue;
}
- if (!isdigit(*cp))
+ if (!isdigit((unsigned char)*cp))
errx(1, "Invalid argument: %s", arg);
if (period) {
diff -r b0e4adb59c26 -r 62a0e308755e usr.sbin/sliplogin/sliplogin.c
--- a/usr.sbin/sliplogin/sliplogin.c Sat Oct 30 15:28:45 2004 +0000
+++ b/usr.sbin/sliplogin/sliplogin.c Sat Oct 30 15:39:39 2004 +0000
@@ -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 @@
#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 @@
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;
diff -r b0e4adb59c26 -r 62a0e308755e usr.sbin/slstats/slstats.c
--- a/usr.sbin/slstats/slstats.c Sat Oct 30 15:28:45 2004 +0000
+++ b/usr.sbin/slstats/slstats.c Sat Oct 30 15:39:39 2004 +0000
@@ -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 @@
usage();
while (argc--) {
- if (isdigit(*argv[0])) {
+ if (isdigit((unsigned char)*argv[0])) {
unit = atoi(*argv);
if (unit < 0)
usage();
diff -r b0e4adb59c26 -r 62a0e308755e usr.sbin/sunlabel/sunlabel.c
--- a/usr.sbin/sunlabel/sunlabel.c Sat Oct 30 15:28:45 2004 +0000
+++ b/usr.sbin/sunlabel/sunlabel.c Sat Oct 30 15:39:39 2004 +0000
@@ -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 @@
nd = 0;
cp = *cpp;
- while (*cp && isdigit(*cp)) {
+ while (*cp && isdigit((unsigned char)*cp)) {
v = (10 * v) + (*cp++ - '0');
nd++;
}
@@ -892,7 +892,7 @@
}
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++) {
diff -r b0e4adb59c26 -r 62a0e308755e usr.sbin/sup/source/expand.c
--- a/usr.sbin/sup/source/expand.c Sat Oct 30 15:28:45 2004 +0000
+++ b/usr.sbin/sup/source/expand.c Sat Oct 30 15:39:39 2004 +0000
@@ -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 @@
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 == '/') {
Home |
Main Index |
Thread Index |
Old Index