Add (unsigned char) cast to ctype functions
This commit is contained in:
parent
9efede97a9
commit
e2f49bd9e2
|
@ -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 @@ backupsa_from_file()
|
|||
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 @@ backupsa_from_file()
|
|||
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 @@ backupsa_from_file()
|
|||
#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 @@ str2num(p, len)
|
|||
|
||||
res = 0;
|
||||
for (i = len; i > 0; i--) {
|
||||
if (!isdigit(*p))
|
||||
if (!isdigit((unsigned char)*p))
|
||||
return -1;
|
||||
res *= 10;
|
||||
res += *p - '0';
|
||||
|
|
|
@ -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 @@ getpsk(str, len)
|
|||
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 */
|
||||
|
|
|
@ -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 @@ str2val(str, base, len)
|
|||
|
||||
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 @@ str2val(str, base, len)
|
|||
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;
|
||||
|
|
|
@ -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 @@ BpfGetIntfName(errmsg)
|
|||
#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) {
|
||||
|
|
|
@ -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 @@ ParseConfig()
|
|||
* 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 @@ ParseAddr(str)
|
|||
/*
|
||||
* 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);
|
||||
}
|
||||
|
|
|
@ -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 @@ main(argc, argv)
|
|||
iface = optarg;
|
||||
break;
|
||||
case 'r':
|
||||
if (isdigit(*optarg)) {
|
||||
if (isdigit((unsigned char)*optarg)) {
|
||||
if (inet_aton(optarg, &route_addr) != 0)
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue