char -> unsigned char
This commit is contained in:
parent
ec1efbf3e5
commit
9794a7e065
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: from.c,v 1.8 1997/10/18 15:08:53 lukem Exp $ */
|
||||
/* $NetBSD: from.c,v 1.9 1998/12/19 16:37:28 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1988, 1993
|
||||
|
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1988, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)from.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: from.c,v 1.8 1997/10/18 15:08:53 lukem Exp $");
|
||||
__RCSID("$NetBSD: from.c,v 1.9 1998/12/19 16:37:28 christos Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -81,7 +81,7 @@ main(argc, argv)
|
|||
case 's':
|
||||
sender = optarg;
|
||||
for (p = sender; *p; ++p)
|
||||
if (isupper(*p))
|
||||
if (isupper((unsigned char)*p))
|
||||
*p = tolower(*p);
|
||||
break;
|
||||
case '?':
|
||||
|
@ -143,17 +143,17 @@ match(line, sender)
|
|||
char ch, pch, first, *p, *t;
|
||||
|
||||
for (first = *sender++;;) {
|
||||
if (isspace(ch = *line))
|
||||
if (isspace((unsigned char)(ch = *line)))
|
||||
return(0);
|
||||
++line;
|
||||
if (isupper(ch))
|
||||
if (isupper((unsigned char)ch))
|
||||
ch = tolower(ch);
|
||||
if (ch != first)
|
||||
continue;
|
||||
for (p = sender, t = line;;) {
|
||||
if (!(pch = *p++))
|
||||
return(1);
|
||||
if (isupper(ch = *t++))
|
||||
if (isupper((unsigned char)(ch = *t++)))
|
||||
ch = tolower(ch);
|
||||
if (ch != pch)
|
||||
break;
|
||||
|
|
|
@ -44,7 +44,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "from: @(#)fsplit.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: fsplit.c,v 1.6 1998/10/08 01:29:49 wsanchez Exp $");
|
||||
__RCSID("$NetBSD: fsplit.c,v 1.7 1998/12/19 16:38:10 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -320,7 +320,7 @@ lname(s)
|
|||
/* copy to buffer and converting to lower case */
|
||||
p = ptr;
|
||||
while (*p && p <= &buf[71] ) {
|
||||
*iptr = isupper(*p) ? tolower(*p) : *p;
|
||||
*iptr = isupper((unsigned char)*p) ? tolower(*p) : *p;
|
||||
iptr++;
|
||||
p++;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: head.c,v 1.10 1998/01/31 20:42:07 christos Exp $ */
|
||||
/* $NetBSD: head.c,v 1.11 1998/12/19 16:40:29 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1987, 1992, 1993
|
||||
|
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1987, 1992, 1993\n\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)head.c 8.2 (Berkeley) 5/4/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: head.c,v 1.10 1998/01/31 20:42:07 christos Exp $");
|
||||
__RCSID("$NetBSD: head.c,v 1.11 1998/12/19 16:40:29 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -148,7 +148,8 @@ obsolete(argv)
|
|||
|
||||
while ((ap = *++argv)) {
|
||||
/* Return if "--" or not "-[0-9]*". */
|
||||
if (ap[0] != '-' || ap[1] == '-' || !isdigit(ap[1]))
|
||||
if (ap[0] != '-' || ap[1] == '-' ||
|
||||
!isdigit((unsigned char)ap[1]))
|
||||
return;
|
||||
if ((ap = malloc(strlen(*argv) + 2)) == NULL)
|
||||
err(1, "%s", "");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: odsyntax.c,v 1.9 1998/08/25 20:59:37 ross Exp $ */
|
||||
/* $NetBSD: odsyntax.c,v 1.10 1998/12/19 16:43:39 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
|
@ -38,7 +38,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)odsyntax.c 8.2 (Berkeley) 5/4/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: odsyntax.c,v 1.9 1998/08/25 20:59:37 ross Exp $");
|
||||
__RCSID("$NetBSD: odsyntax.c,v 1.10 1998/12/19 16:43:39 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -183,7 +183,8 @@ odoffset(argc, argvp)
|
|||
return;
|
||||
|
||||
if (*p != '+' && (argc < 2 ||
|
||||
(!isdigit(p[0]) && (p[0] != 'x' || !isxdigit(p[1])))))
|
||||
(!isdigit((unsigned char)p[0]) &&
|
||||
(p[0] != 'x' || !isxdigit((unsigned char)p[1])))))
|
||||
return;
|
||||
|
||||
base = 0;
|
||||
|
@ -193,7 +194,7 @@ odoffset(argc, argvp)
|
|||
*/
|
||||
if (p[0] == '+')
|
||||
++p;
|
||||
if (p[0] == 'x' && isxdigit(p[1])) {
|
||||
if (p[0] == 'x' && isxdigit((unsigned char)p[1])) {
|
||||
++p;
|
||||
base = 16;
|
||||
} else if (p[0] == '0' && p[1] == 'x') {
|
||||
|
@ -203,9 +204,9 @@ odoffset(argc, argvp)
|
|||
|
||||
/* skip over the number */
|
||||
if (base == 16)
|
||||
for (num = p; isxdigit(*p); ++p);
|
||||
for (num = p; isxdigit((unsigned char)*p); ++p);
|
||||
else
|
||||
for (num = p; isdigit(*p); ++p);
|
||||
for (num = p; isdigit((unsigned char)*p); ++p);
|
||||
|
||||
/* check for no number */
|
||||
if (num == p)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: parse.c,v 1.7 1997/10/19 02:34:10 lukem Exp $ */
|
||||
/* $NetBSD: parse.c,v 1.8 1998/12/19 16:43:39 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
|
@ -38,7 +38,7 @@
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: parse.c,v 1.7 1997/10/19 02:34:10 lukem Exp $");
|
||||
__RCSID("$NetBSD: parse.c,v 1.8 1998/12/19 16:43:39 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -75,7 +75,7 @@ addfile(name)
|
|||
continue;
|
||||
}
|
||||
*p = '\0';
|
||||
for (p = buf; *p && isspace(*p); ++p);
|
||||
for (p = buf; *p && isspace((unsigned char)*p); ++p);
|
||||
if (!*p || *p == '#')
|
||||
continue;
|
||||
add(p);
|
||||
|
@ -105,7 +105,7 @@ add(fmt)
|
|||
/* take the format string and break it up into format units */
|
||||
for (p = fmt;;) {
|
||||
/* skip leading white space */
|
||||
for (; isspace(*p); ++p);
|
||||
for (; isspace((unsigned char)*p); ++p);
|
||||
if (!*p)
|
||||
break;
|
||||
|
||||
|
@ -116,29 +116,29 @@ add(fmt)
|
|||
tfu->reps = 1;
|
||||
|
||||
/* if leading digit, repetition count */
|
||||
if (isdigit(*p)) {
|
||||
for (savep = p; isdigit(*p); ++p);
|
||||
if (!isspace(*p) && *p != '/')
|
||||
if (isdigit((unsigned char)*p)) {
|
||||
for (savep = p; isdigit((unsigned char)*p); ++p);
|
||||
if (!isspace((unsigned char)*p) && *p != '/')
|
||||
badfmt(fmt);
|
||||
/* may overwrite either white space or slash */
|
||||
tfu->reps = atoi(savep);
|
||||
tfu->flags = F_SETREP;
|
||||
/* skip trailing white space */
|
||||
for (++p; isspace(*p); ++p);
|
||||
for (++p; isspace((unsigned char)*p); ++p);
|
||||
}
|
||||
|
||||
/* skip slash and trailing white space */
|
||||
if (*p == '/')
|
||||
while (isspace(*++p));
|
||||
while (isspace((unsigned char)*++p));
|
||||
|
||||
/* byte count */
|
||||
if (isdigit(*p)) {
|
||||
for (savep = p; isdigit(*p); ++p);
|
||||
if (!isspace(*p))
|
||||
if (isdigit((unsigned char)*p)) {
|
||||
for (savep = p; isdigit((unsigned char)*p); ++p);
|
||||
if (!isspace((unsigned char)*p))
|
||||
badfmt(fmt);
|
||||
tfu->bcnt = atoi(savep);
|
||||
/* skip trailing white space */
|
||||
for (++p; isspace(*p); ++p);
|
||||
for (++p; isspace((unsigned char)*p); ++p);
|
||||
}
|
||||
|
||||
/* format */
|
||||
|
@ -181,9 +181,9 @@ size(fs)
|
|||
* case it's a %s format.
|
||||
*/
|
||||
while (strchr(spec + 1, *++fmt));
|
||||
if (*fmt == '.' && isdigit(*++fmt)) {
|
||||
if (*fmt == '.' && isdigit((unsigned char)*++fmt)) {
|
||||
prec = atoi(fmt);
|
||||
while (isdigit(*++fmt));
|
||||
while (isdigit((unsigned char)*++fmt));
|
||||
}
|
||||
switch(*fmt) {
|
||||
case 'c':
|
||||
|
@ -258,10 +258,12 @@ rewrite(fs)
|
|||
} else {
|
||||
/* Skip any special chars, field width. */
|
||||
while (strchr(spec + 1, *++p1));
|
||||
if (*p1 == '.' && isdigit(*++p1)) {
|
||||
if (*p1 == '.' &&
|
||||
isdigit((unsigned char)*++p1)) {
|
||||
sokay = USEPREC;
|
||||
prec = atoi(p1);
|
||||
while (isdigit(*++p1));
|
||||
while (isdigit((unsigned char)*++p1))
|
||||
continue;
|
||||
} else
|
||||
sokay = NOTOKAY;
|
||||
}
|
||||
|
@ -432,7 +434,7 @@ isint2: switch(fu->bcnt) {
|
|||
if (!pr->nextpr)
|
||||
break;
|
||||
for (p1 = pr->fmt, p2 = NULL; *p1; ++p1)
|
||||
p2 = isspace(*p1) ? p1 : NULL;
|
||||
p2 = isspace((unsigned char)*p1) ? p1 : NULL;
|
||||
if (p2)
|
||||
pr->nospace = p2;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue