Add (unsigned char) cast to ctype functions

This commit is contained in:
dsl 2004-10-30 20:56:20 +00:00
parent 108eb2ab42
commit dfdc37e2fe
2 changed files with 14 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.47 2004/09/04 23:35:43 manu Exp $ */
/* $NetBSD: main.c,v 1.48 2004/10/30 20:56:20 dsl Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\n\
#if 0
static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94";
#else
__RCSID("$NetBSD: main.c,v 1.47 2004/09/04 23:35:43 manu Exp $");
__RCSID("$NetBSD: main.c,v 1.48 2004/10/30 20:56:20 dsl Exp $");
#endif
#endif /* not lint */
@ -494,7 +494,7 @@ main(argc, argv)
#define BACKWARD_COMPATIBILITY
#ifdef BACKWARD_COMPATIBILITY
if (*argv) {
if (isdigit(**argv)) {
if (isdigit((unsigned char)**argv)) {
interval = atoi(*argv);
if (interval <= 0)
usage();

View File

@ -1,4 +1,4 @@
/* $NetBSD: newsyslog.c,v 1.47 2003/10/13 07:28:52 lukem Exp $ */
/* $NetBSD: newsyslog.c,v 1.48 2004/10/30 21:03:36 dsl Exp $ */
/*
* Copyright (c) 1999, 2000 Andrew Doran <ad@NetBSD.org>
@ -55,7 +55,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: newsyslog.c,v 1.47 2003/10/13 07:28:52 lukem Exp $");
__RCSID("$NetBSD: newsyslog.c,v 1.48 2004/10/30 21:03:36 dsl Exp $");
#endif /* not lint */
#include <sys/types.h>
@ -297,17 +297,14 @@ parse_cfgline(struct conf_entry *log, FILE *fd, size_t *_lineno)
}
/* size */
if (isdigit(**ap)) {
if (**ap == '*')
log->maxsize = (size_t)-1;
else {
log->maxsize = (int)strtol(*ap, &q, 0);
if (*q != '\0') {
warnx("config line %d: bad log size", lineno);
goto bad;
}
} else if (**ap == '*')
log->maxsize = (size_t)-1;
else {
warnx("config line %d: bad log size", lineno);
goto bad;
}
ap++;
@ -317,7 +314,7 @@ parse_cfgline(struct conf_entry *log, FILE *fd, size_t *_lineno)
q = *ap++;
if (strcmp(q, "*") != 0) {
if (isdigit(*q))
if (isdigit((unsigned char)*q))
log->maxage = (int)strtol(q, &q, 10);
/*
@ -345,7 +342,7 @@ parse_cfgline(struct conf_entry *log, FILE *fd, size_t *_lineno)
log->flags = (nosignal ? CE_NOSIGNAL : 0);
for (q = *ap++; q != NULL && *q != '\0'; q++) {
switch (tolower(*q)) {
switch (tolower((unsigned char)*q)) {
case 'b':
log->flags |= CE_BINARY;
break;
@ -713,7 +710,7 @@ int
isnumber(const char *string)
{
while (isdigit(*string))
while (isdigit((unsigned char)*string))
string++;
return (*string == '\0');
@ -909,7 +906,7 @@ parse_dwm(char *s)
return (-1);
wmseen++;
s++;
if (tolower(*s) == 'l') {
if (tolower((unsigned char)*s) == 'l') {
tm.tm_mday = nd;
s++;
t = s;
@ -929,7 +926,7 @@ parse_dwm(char *s)
break;
}
if (*t == '\0' || isspace(*t))
if (*t == '\0' || isspace((unsigned char)*t))
break;
else
s = t;
@ -1000,7 +997,7 @@ parse_iso8601(char *s)
if (*t != '\0') {
s = ++t;
ul = strtoul(s, &t, 10);
if (*t != '\0' && !isspace(*t))
if (*t != '\0' && !isspace((unsigned char)*t))
return ((time_t)-1);
switch (t - s) {