Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Add (unsigned char) cast to ctype functions
details: https://anonhg.NetBSD.org/src/rev/c2ca65fb7edd
branches: trunk
changeset: 570829:c2ca65fb7edd
user: dsl <dsl%NetBSD.org@localhost>
date: Sat Oct 30 15:15:37 2004 +0000
description:
Add (unsigned char) cast to ctype functions
diffstat:
crypto/dist/kame/racoon/backupsa.c | 10 +++++-----
crypto/dist/kame/racoon/localconf.c | 6 +++---
crypto/dist/kame/racoon/str2val.c | 8 ++++----
usr.sbin/rbootd/bpf.c | 6 +++---
usr.sbin/rbootd/parseconf.c | 14 +++++++-------
usr.sbin/rpc.bootparamd/bootparamd.c | 6 +++---
6 files changed, 25 insertions(+), 25 deletions(-)
diffs (207 lines):
diff -r 974d1a44ef3b -r c2ca65fb7edd crypto/dist/kame/racoon/backupsa.c
--- a/crypto/dist/kame/racoon/backupsa.c Sat Oct 30 15:04:45 2004 +0000
+++ b/crypto/dist/kame/racoon/backupsa.c Sat Oct 30 15:15:37 2004 +0000
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: backupsa.c,v 1.8 2003/07/12 09:37:09 itojun Exp $");
+__RCSID("$NetBSD: backupsa.c,v 1.9 2004/10/30 15:15:37 dsl Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -251,7 +251,7 @@
created = mktime(&tm);
p++;
- for (q = p; *q != '\0' && !isspace(*q); q++)
+ for (q = p; *q != '\0' && !isspace((unsigned char)*q); q++)
;
*q = '\0';
src = str2saddr(p, NULL);
@@ -259,7 +259,7 @@
goto err;
p = q + 1;
- for (q = p; *q != '\0' && !isspace(*q); q++)
+ for (q = p; *q != '\0' && !isspace((unsigned char)*q); q++)
;
*q = '\0';
dst = str2saddr(p, NULL);
@@ -272,7 +272,7 @@
#define GETNEXTNUM(value, function) \
do { \
char *y; \
- for (q = p; *q != '\0' && !isspace(*q); q++) \
+ for (q = p; *q != '\0' && !isspace((unsigned char)*q); q++) \
; \
*q = '\0'; \
(value) = function(p, &y, 10); \
@@ -454,7 +454,7 @@
res = 0;
for (i = len; i > 0; i--) {
- if (!isdigit(*p))
+ if (!isdigit((unsigned char)*p))
return -1;
res *= 10;
res += *p - '0';
diff -r 974d1a44ef3b -r c2ca65fb7edd crypto/dist/kame/racoon/localconf.c
--- a/crypto/dist/kame/racoon/localconf.c Sat Oct 30 15:04:45 2004 +0000
+++ b/crypto/dist/kame/racoon/localconf.c Sat Oct 30 15:15:37 2004 +0000
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: localconf.c,v 1.2 2003/07/12 09:37:11 itojun Exp $");
+__RCSID("$NetBSD: localconf.c,v 1.3 2004/10/30 15:15:38 dsl Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -192,13 +192,13 @@
continue;
/* search the end of 1st string. */
- for (p = buf; *p != '\0' && !isspace(*p); p++)
+ for (p = buf; *p != '\0' && !isspace((unsigned char)*p); p++)
;
if (*p == '\0')
continue; /* no 2nd parameter */
*p = '\0';
/* search the 1st of 2nd string. */
- while (isspace(*++p))
+ while (isspace((unsigned char)*++p))
;
if (*p == '\0')
continue; /* no 2nd parameter */
diff -r 974d1a44ef3b -r c2ca65fb7edd crypto/dist/kame/racoon/str2val.c
--- a/crypto/dist/kame/racoon/str2val.c Sat Oct 30 15:04:45 2004 +0000
+++ b/crypto/dist/kame/racoon/str2val.c Sat Oct 30 15:15:37 2004 +0000
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: str2val.c,v 1.2 2003/07/12 09:37:12 itojun Exp $");
+__RCSID("$NetBSD: str2val.c,v 1.3 2004/10/30 15:15:38 dsl Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -88,9 +88,9 @@
i = 0;
for (p = str; *p != '\0'; p++) {
- if (isxdigit(*p))
+ if (isxdigit((unsigned char)*p))
i++;
- else if (isspace(*p))
+ else if (isspace((unsigned char)*p))
;
else
return NULL;
@@ -105,7 +105,7 @@
i = 0;
f = 0;
for (rp = dst, p = str; *p != '\0'; p++) {
- if (isxdigit(*p)) {
+ if (isxdigit((unsigned char)*p)) {
if (!f) {
b[0] = *p;
f = 1;
diff -r 974d1a44ef3b -r c2ca65fb7edd usr.sbin/rbootd/bpf.c
--- a/usr.sbin/rbootd/bpf.c Sat Oct 30 15:04:45 2004 +0000
+++ b/usr.sbin/rbootd/bpf.c Sat Oct 30 15:15:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.16 2004/04/10 17:53:05 darrenr Exp $ */
+/* $NetBSD: bpf.c,v 1.17 2004/10/30 15:20:36 dsl Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -89,7 +89,7 @@
#if 0
static char sccsid[] = "@(#)bpf.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: bpf.c,v 1.16 2004/04/10 17:53:05 darrenr Exp $");
+__RCSID("$NetBSD: bpf.c,v 1.17 2004/10/30 15:20:36 dsl Exp $");
#endif
#endif /* not lint */
@@ -296,7 +296,7 @@
#endif
continue;
- for (cp = ifa->ifa_name; !isdigit(*cp); ++cp)
+ for (cp = ifa->ifa_name; !isdigit((unsigned char)*cp); ++cp)
;
n = atoi(cp);
if (n < minunit) {
diff -r 974d1a44ef3b -r c2ca65fb7edd usr.sbin/rbootd/parseconf.c
--- a/usr.sbin/rbootd/parseconf.c Sat Oct 30 15:04:45 2004 +0000
+++ b/usr.sbin/rbootd/parseconf.c Sat Oct 30 15:15:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parseconf.c,v 1.8 2003/08/07 11:25:41 agc Exp $ */
+/* $NetBSD: parseconf.c,v 1.9 2004/10/30 15:20:36 dsl Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -89,7 +89,7 @@
#if 0
static char sccsid[] = "@(#)parseconf.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: parseconf.c,v 1.8 2003/08/07 11:25:41 agc Exp $");
+__RCSID("$NetBSD: parseconf.c,v 1.9 2004/10/30 15:20:36 dsl Exp $");
#endif
#endif /* not lint */
@@ -158,9 +158,9 @@
* and null terminates it. `cp' is positioned at the start
* of the next token. spaces & commas are separators.
*/
-#define GETSTR while (isspace(*cp) || *cp == ',') cp++; \
- bcp = cp; \
- while (*cp && *cp!=',' && !isspace(*cp)) cp++; \
+#define GETSTR while (isspace((unsigned char)*cp) || *cp == ',') cp++; \
+ bcp = cp; \
+ while (*cp && *cp!=',' && !isspace((unsigned char)*cp)) cp++;\
if (*cp) *cp++ = '\0'
/*
@@ -313,10 +313,10 @@
/*
* Convert hex character to an integer.
*/
- if (isdigit(*cp))
+ if (isdigit((unsigned char)*cp))
i = *cp - '0';
else {
- i = (isupper(*cp)? tolower(*cp): *cp) - 'a' + 10;
+ i = tolower((unsigned char)*cp) - 'a' + 10;
if (i < 10 || i > 15) /* not a hex char */
return(NULL);
}
diff -r 974d1a44ef3b -r c2ca65fb7edd usr.sbin/rpc.bootparamd/bootparamd.c
--- a/usr.sbin/rpc.bootparamd/bootparamd.c Sat Oct 30 15:04:45 2004 +0000
+++ b/usr.sbin/rpc.bootparamd/bootparamd.c Sat Oct 30 15:15:37 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bootparamd.c,v 1.43 2004/09/07 13:20:40 jrf Exp $ */
+/* $NetBSD: bootparamd.c,v 1.44 2004/10/30 15:23:30 dsl Exp $ */
/*
* This code is not copyright, and is placed in the public domain.
@@ -11,7 +11,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: bootparamd.c,v 1.43 2004/09/07 13:20:40 jrf Exp $");
+__RCSID("$NetBSD: bootparamd.c,v 1.44 2004/10/30 15:23:30 dsl Exp $");
#endif
#include <sys/types.h>
@@ -92,7 +92,7 @@
iface = optarg;
break;
case 'r':
- if (isdigit(*optarg)) {
+ if (isdigit((unsigned char)*optarg)) {
if (inet_aton(optarg, &route_addr) != 0)
break;
}
Home |
Main Index |
Thread Index |
Old Index