mirror of
https://github.com/openbsd/src.git
synced 2025-01-03 06:45:37 -08:00
unsigned char casts for ctype
ok krw
This commit is contained in:
parent
9596d54da0
commit
6cd4fad2c3
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: day.c,v 1.26 2013/11/12 19:35:47 deraadt Exp $ */
|
||||
/* $OpenBSD: day.c,v 1.27 2013/11/26 13:18:53 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993, 1994
|
||||
@ -88,7 +88,7 @@ setnnames(void)
|
||||
for (i = 0; i < 7; i++) {
|
||||
tm.tm_wday = i;
|
||||
l = strftime(buf, sizeof(buf), "%a", &tm);
|
||||
for (; l > 0 && isspace((int)buf[l - 1]); l--)
|
||||
for (; l > 0 && isspace((unsigned char)buf[l - 1]); l--)
|
||||
;
|
||||
buf[l] = '\0';
|
||||
if (ndays[i].name != NULL)
|
||||
@ -98,7 +98,7 @@ setnnames(void)
|
||||
ndays[i].len = strlen(buf);
|
||||
|
||||
l = strftime(buf, sizeof(buf), "%A", &tm);
|
||||
for (; l > 0 && isspace((int)buf[l - 1]); l--)
|
||||
for (; l > 0 && isspace((unsigned char)buf[l - 1]); l--)
|
||||
;
|
||||
buf[l] = '\0';
|
||||
if (fndays[i].name != NULL)
|
||||
@ -111,7 +111,7 @@ setnnames(void)
|
||||
for (i = 0; i < 12; i++) {
|
||||
tm.tm_mon = i;
|
||||
l = strftime(buf, sizeof(buf), "%b", &tm);
|
||||
for (; l > 0 && isspace((int)buf[l - 1]); l--)
|
||||
for (; l > 0 && isspace((unsigned char)buf[l - 1]); l--)
|
||||
;
|
||||
buf[l] = '\0';
|
||||
if (nmonths[i].name != NULL)
|
||||
@ -121,7 +121,7 @@ setnnames(void)
|
||||
nmonths[i].len = strlen(buf);
|
||||
|
||||
l = strftime(buf, sizeof(buf), "%B", &tm);
|
||||
for (; l > 0 && isspace((int)buf[l - 1]); l--)
|
||||
for (; l > 0 && isspace((unsigned char)buf[l - 1]); l--)
|
||||
;
|
||||
buf[l] = '\0';
|
||||
if (fnmonths[i].name != NULL)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: io.c,v 1.35 2009/10/27 23:59:36 deraadt Exp $ */
|
||||
/* $OpenBSD: io.c,v 1.36 2013/11/26 13:18:53 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993, 1994
|
||||
@ -222,26 +222,28 @@ getfield(char *p, char **endp, int *flags)
|
||||
int val, var, i;
|
||||
char *start, savech;
|
||||
|
||||
for (; !isdigit(*p) && !isalpha(*p) && *p != '*' && *p != '\t'; ++p)
|
||||
for (; !isdigit((unsigned char)*p) && !isalpha((unsigned char)*p) &&
|
||||
*p != '*' && *p != '\t'; ++p)
|
||||
;
|
||||
if (*p == '*') { /* `*' is every month */
|
||||
*flags |= F_ISMONTH;
|
||||
*endp = p+1;
|
||||
return (-1); /* means 'every month' */
|
||||
}
|
||||
if (isdigit(*p)) {
|
||||
if (isdigit((unsigned char)*p)) {
|
||||
val = strtol(p, &p, 10); /* if 0, it's failure */
|
||||
for (; !isdigit(*p) && !isalpha(*p) && *p != '*'; ++p)
|
||||
for (; !isdigit((unsigned char)*p) &&
|
||||
!isalpha((unsigned char)*p) && *p != '*'; ++p)
|
||||
;
|
||||
*endp = p;
|
||||
return (val);
|
||||
}
|
||||
for (start = p; isalpha(*++p);)
|
||||
for (start = p; isalpha((unsigned char)*++p);)
|
||||
;
|
||||
|
||||
/* Sunday-1 */
|
||||
if (*p == '+' || *p == '-')
|
||||
for(; isdigit(*++p); )
|
||||
for(; isdigit((unsigned char)*++p); )
|
||||
;
|
||||
|
||||
savech = *p;
|
||||
@ -301,7 +303,8 @@ getfield(char *p, char **endp, int *flags)
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
for (*p = savech; !isdigit(*p) && !isalpha(*p) && *p != '*' && *p != '\t'; ++p)
|
||||
for (*p = savech; !isdigit((unsigned char)*p) &&
|
||||
!isalpha((unsigned char)*p) && *p != '*' && *p != '\t'; ++p)
|
||||
;
|
||||
*endp = p;
|
||||
return (val);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: edit.c,v 1.33 2009/10/27 23:59:36 deraadt Exp $ */
|
||||
/* $OpenBSD: edit.c,v 1.34 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
/* $NetBSD: edit.c,v 1.6 1996/05/15 21:50:45 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
@ -173,8 +173,9 @@ verify(char *tempname, struct passwd *pw)
|
||||
warnx("line %u corrupted", line);
|
||||
goto bad;
|
||||
}
|
||||
while (isspace(*++p));
|
||||
for (q = p; isprint(*q); q++) {
|
||||
while (isspace((unsigned char)*++p))
|
||||
;
|
||||
for (q = p; isprint((unsigned char)*q); q++) {
|
||||
if (ep->except && strchr(ep->except,*q))
|
||||
break;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: field.c,v 1.12 2009/10/27 23:59:36 deraadt Exp $ */
|
||||
/* $OpenBSD: field.c,v 1.13 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
/* $NetBSD: field.c,v 1.3 1995/03/26 04:55:28 glass Exp $ */
|
||||
|
||||
/*
|
||||
@ -69,7 +69,7 @@ p_login(char *p, struct passwd *pw, ENTRY *ep)
|
||||
if (strchr(p, '.'))
|
||||
warnx("\'.\' is dangerous in a login name");
|
||||
for (; *p; ++p)
|
||||
if (isupper(*p)) {
|
||||
if (isupper((unsigned char)*p)) {
|
||||
warnx("upper-case letters are dangerous in a login name");
|
||||
break;
|
||||
}
|
||||
@ -122,7 +122,7 @@ p_gid(char *p, struct passwd *pw, ENTRY *ep)
|
||||
warnx("empty gid field");
|
||||
return (1);
|
||||
}
|
||||
if (!isdigit(*p)) {
|
||||
if (!isdigit((unsigned char)*p)) {
|
||||
if (!(gr = getgrnam(p))) {
|
||||
warnx("unknown group %s", p);
|
||||
return (1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: column.c,v 1.15 2009/10/27 23:59:36 deraadt Exp $ */
|
||||
/* $OpenBSD: column.c,v 1.16 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
/* $NetBSD: column.c,v 1.4 1995/09/02 05:53:03 jtc Exp $ */
|
||||
|
||||
/*
|
||||
@ -256,7 +256,7 @@ input(FILE *fp)
|
||||
if (!list)
|
||||
list = emalloc((maxentry = DEFNUM) * sizeof(char *));
|
||||
while (fgets(buf, MAXLINELEN, fp)) {
|
||||
for (p = buf; isspace(*p); ++p);
|
||||
for (p = buf; isspace((unsigned char)*p); ++p);
|
||||
if (!*p)
|
||||
continue;
|
||||
if (!(p = strchr(p, '\n'))) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: fortran.c,v 1.8 2012/03/04 04:05:15 fgsch Exp $ */
|
||||
/* $OpenBSD: fortran.c,v 1.9 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
/* $NetBSD: fortran.c,v 1.3 1995/03/26 20:14:08 glass Exp $ */
|
||||
|
||||
/*
|
||||
@ -56,7 +56,7 @@ PF_funcs(void)
|
||||
lbp = lbuf;
|
||||
if (*lbp == '%') /* Ratfor escape to fortran */
|
||||
++lbp;
|
||||
for (; isspace(*lbp); ++lbp)
|
||||
for (; isspace((unsigned char)*lbp); ++lbp)
|
||||
continue;
|
||||
if (!*lbp)
|
||||
continue;
|
||||
@ -67,7 +67,7 @@ PF_funcs(void)
|
||||
break;
|
||||
case 'd':
|
||||
if (cicmp("double")) {
|
||||
for (; isspace(*lbp); ++lbp)
|
||||
for (; isspace((unsigned char)*lbp); ++lbp)
|
||||
continue;
|
||||
if (!*lbp)
|
||||
continue;
|
||||
@ -89,7 +89,7 @@ PF_funcs(void)
|
||||
takeprec();
|
||||
break;
|
||||
}
|
||||
for (; isspace(*lbp); ++lbp)
|
||||
for (; isspace((unsigned char)*lbp); ++lbp)
|
||||
continue;
|
||||
if (!*lbp)
|
||||
continue;
|
||||
@ -108,7 +108,7 @@ PF_funcs(void)
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
for (; isspace(*lbp); ++lbp)
|
||||
for (; isspace((unsigned char)*lbp); ++lbp)
|
||||
continue;
|
||||
if (!*lbp)
|
||||
continue;
|
||||
@ -148,15 +148,15 @@ cicmp(char *cp)
|
||||
static void
|
||||
takeprec(void)
|
||||
{
|
||||
for (; isspace(*lbp); ++lbp)
|
||||
for (; isspace((unsigned char)*lbp); ++lbp)
|
||||
continue;
|
||||
if (*lbp == '*') {
|
||||
for (++lbp; isspace(*lbp); ++lbp)
|
||||
for (++lbp; isspace((unsigned char)*lbp); ++lbp)
|
||||
continue;
|
||||
if (!isdigit(*lbp))
|
||||
if (!isdigit((unsigned char)*lbp))
|
||||
--lbp; /* force failure */
|
||||
else
|
||||
while (isdigit(*++lbp))
|
||||
while (isdigit((unsigned char)*++lbp))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: lisp.c,v 1.7 2012/03/04 04:05:15 fgsch Exp $ */
|
||||
/* $OpenBSD: lisp.c,v 1.8 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
/* $NetBSD: lisp.c,v 1.3 1995/03/26 20:14:09 glass Exp $ */
|
||||
|
||||
/*
|
||||
@ -67,9 +67,9 @@ l_entries(void)
|
||||
if (cicmp("wrapper") || cicmp("whopper"))
|
||||
special = YES;
|
||||
}
|
||||
for (; !isspace(*lbp); ++lbp)
|
||||
for (; !isspace((unsigned char)*lbp); ++lbp)
|
||||
continue;
|
||||
for (; isspace(*lbp); ++lbp)
|
||||
for (; isspace((unsigned char)*lbp); ++lbp)
|
||||
continue;
|
||||
for (cp = lbp; *cp && *cp != '\n'; ++cp)
|
||||
continue;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: expand.c,v 1.11 2009/10/27 23:59:37 deraadt Exp $ */
|
||||
/* $OpenBSD: expand.c,v 1.12 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
/* $NetBSD: expand.c,v 1.5 1995/09/02 06:19:46 jtc Exp $ */
|
||||
|
||||
/*
|
||||
@ -52,7 +52,8 @@ main(int argc, char *argv[])
|
||||
int n;
|
||||
|
||||
/* handle obsolete syntax */
|
||||
while (argc > 1 && argv[1][0] == '-' && isdigit(argv[1][1])) {
|
||||
while (argc > 1 && argv[1][0] == '-' &&
|
||||
isdigit((unsigned char)argv[1][1])) {
|
||||
getstops(&argv[1][1]);
|
||||
argc--; argv++;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: util.c,v 1.23 2009/10/27 23:59:38 deraadt Exp $ */
|
||||
/* $OpenBSD: util.c,v 1.24 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
@ -182,7 +182,7 @@ expandusername(char *gecos, char *login, char *buf, int buflen)
|
||||
if (*p == '&') {
|
||||
/* interpolate full name */
|
||||
strlcpy(bp, login, buflen - (bp - buf));
|
||||
*bp = toupper(*bp);
|
||||
*bp = toupper((unsigned char)*bp);
|
||||
bp += strlen(bp);
|
||||
}
|
||||
else
|
||||
@ -342,7 +342,7 @@ prphone(char *num)
|
||||
|
||||
/* don't touch anything if the user has their own formatting */
|
||||
for (p = num; *p; ++p)
|
||||
if (!isdigit(*p))
|
||||
if (!isdigit((unsigned char)*p))
|
||||
return (num);
|
||||
len = p - num;
|
||||
p = pbuf;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: fmt.c,v 1.29 2012/01/17 04:26:28 lum Exp $ */
|
||||
/* $OpenBSD: fmt.c,v 1.30 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
|
||||
/* Sensible version of fmt
|
||||
*
|
||||
@ -233,7 +233,7 @@ static int output_in_paragraph = 0; /* Any of current para written out yet? */
|
||||
static void process_named_file(const char *);
|
||||
static void process_stream(FILE *, const char *);
|
||||
static size_t indent_length(const char *, size_t);
|
||||
static int might_be_header(const unsigned char *);
|
||||
static int might_be_header(const char *);
|
||||
static void new_paragraph(size_t, size_t);
|
||||
static void output_word(size_t, size_t, const char *, size_t, size_t);
|
||||
static void output_indent(size_t);
|
||||
@ -385,7 +385,7 @@ process_stream(FILE *stream, const char *name)
|
||||
HdrType header_type;
|
||||
|
||||
/* ^-- header_type of previous line; -1 at para start */
|
||||
char *line;
|
||||
const char *line;
|
||||
size_t length;
|
||||
|
||||
if (centerP) {
|
||||
@ -486,14 +486,14 @@ indent_length(const char *line, size_t length)
|
||||
* conservative to avoid mangling ordinary civilised text.
|
||||
*/
|
||||
static int
|
||||
might_be_header(const unsigned char *line)
|
||||
might_be_header(const char *line)
|
||||
{
|
||||
|
||||
if (!isupper(*line++))
|
||||
if (!isupper((unsigned char)*line++))
|
||||
return 0;
|
||||
while (isalnum(*line) || *line == '-')
|
||||
while (isalnum((unsigned char)*line) || *line == '-')
|
||||
++line;
|
||||
return (*line == ':' && isspace(line[1]));
|
||||
return (*line == ':' && isspace((unsigned char)line[1]));
|
||||
}
|
||||
|
||||
/* Begin a new paragraph with an indent of |indent| spaces.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: from.c,v 1.14 2009/10/27 23:59:38 deraadt Exp $ */
|
||||
/* $OpenBSD: from.c,v 1.15 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
/* $NetBSD: from.c,v 1.6 1995/09/01 01:39:10 jtc Exp $ */
|
||||
|
||||
/*
|
||||
@ -63,8 +63,8 @@ main(int argc, char *argv[])
|
||||
case 's':
|
||||
sender = optarg;
|
||||
for (p = sender; *p; ++p)
|
||||
if (isupper(*p))
|
||||
*p = tolower(*p);
|
||||
if (isupper((unsigned char)*p))
|
||||
*p = tolower((unsigned char)*p);
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
@ -122,18 +122,18 @@ match(char *line, char *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))
|
||||
ch = tolower(ch);
|
||||
if (isupper((unsigned char)ch))
|
||||
ch = tolower((unsigned char)ch);
|
||||
if (ch != first)
|
||||
continue;
|
||||
for (p = sender, t = line;;) {
|
||||
if (!(pch = *p++))
|
||||
return(1);
|
||||
if (isupper(ch = *t++))
|
||||
ch = tolower(ch);
|
||||
if (isupper((unsigned char)(ch = *t++)))
|
||||
ch = tolower((unsigned char)ch);
|
||||
if (ch != pch)
|
||||
break;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: fsplit.c,v 1.19 2012/03/04 04:05:15 fgsch Exp $ */
|
||||
/* $OpenBSD: fsplit.c,v 1.20 2013/11/26 13:18:55 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@ -328,7 +328,7 @@ lname(char *s, size_t len)
|
||||
/* copy to buffer and converting to lower case */
|
||||
p = ptr;
|
||||
while (*p && p <= &buf[71]) {
|
||||
*iptr = tolower(*p);
|
||||
*iptr = tolower((unsigned char)*p);
|
||||
iptr++;
|
||||
p++;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: grep.h,v 1.18 2012/12/29 01:32:44 millert Exp $ */
|
||||
/* $OpenBSD: grep.h,v 1.19 2013/11/26 13:21:16 deraadt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
|
||||
@ -86,7 +86,7 @@ void *grep_calloc(size_t nmemb, size_t size);
|
||||
void *grep_realloc(void *ptr, size_t size);
|
||||
void printline(str_t *line, int sep, regmatch_t *pmatch);
|
||||
int fastcomp(fastgrep_t *, const char *);
|
||||
void fgrepcomp(fastgrep_t *, const char *);
|
||||
void fgrepcomp(fastgrep_t *, const unsigned char *);
|
||||
|
||||
/* queue.c */
|
||||
void initqueue(void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: util.c,v 1.46 2013/05/04 00:26:20 tedu Exp $ */
|
||||
/* $OpenBSD: util.c,v 1.47 2013/11/26 13:21:16 deraadt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
|
||||
@ -165,7 +165,7 @@ procfile(char *fn)
|
||||
* Process an individual line in a file. Return non-zero if it matches.
|
||||
*/
|
||||
|
||||
#define isword(x) (isalnum(x) || (x) == '_')
|
||||
#define isword(x) (isalnum((unsigned char)x) || (x) == '_')
|
||||
|
||||
static int
|
||||
procline(str_t *l, int nottext)
|
||||
@ -245,7 +245,7 @@ print:
|
||||
|
||||
#ifndef SMALL
|
||||
void
|
||||
fgrepcomp(fastgrep_t *fg, const char *pattern)
|
||||
fgrepcomp(fastgrep_t *fg, const unsigned char *pattern)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: head.c,v 1.15 2009/10/27 23:59:38 deraadt Exp $ */
|
||||
/* $OpenBSD: head.c,v 1.16 2013/11/26 13:21:17 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1987 Regents of the University of California.
|
||||
@ -54,7 +54,8 @@ main(int argc, char *argv[])
|
||||
char *p = NULL;
|
||||
|
||||
/* handle obsolete -number syntax */
|
||||
if (argc > 1 && argv[1][0] == '-' && isdigit(argv[1][1])) {
|
||||
if (argc > 1 && argv[1][0] == '-' &&
|
||||
isdigit((unsigned char)argv[1][1])) {
|
||||
p = argv[1] + 1;
|
||||
argc--;
|
||||
argv++;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: args.c,v 1.16 2013/06/20 06:28:15 jsg Exp $ */
|
||||
/* $OpenBSD: args.c,v 1.17 2013/11/26 13:21:17 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -293,7 +293,7 @@ found:
|
||||
break;
|
||||
|
||||
case PRO_INT:
|
||||
if (!isdigit(*param_start)) {
|
||||
if (!isdigit((unsigned char)*param_start)) {
|
||||
need_param:
|
||||
errx(1, "%s: ``%s'' requires a parameter", option_source, arg - 1);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: indent.c,v 1.22 2013/06/21 06:49:42 jsg Exp $ */
|
||||
/* $OpenBSD: indent.c,v 1.23 2013/11/26 13:21:17 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -968,8 +968,9 @@ check_type:
|
||||
e_code = chfont(&bodyf, &keywordf, e_code);
|
||||
for (t_ptr = token; *t_ptr; ++t_ptr) {
|
||||
CHECK_SIZE_CODE;
|
||||
*e_code++ = keywordf.allcaps && islower(*t_ptr)
|
||||
? toupper(*t_ptr) : *t_ptr;
|
||||
*e_code++ = keywordf.allcaps &&
|
||||
islower((unsigned char)*t_ptr) ?
|
||||
toupper((unsigned char)*t_ptr) : *t_ptr;
|
||||
}
|
||||
e_code = chfont(&keywordf, &bodyf, e_code);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: io.c,v 1.12 2013/06/20 06:28:15 jsg Exp $ */
|
||||
/* $OpenBSD: io.c,v 1.13 2013/11/26 13:21:17 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985 Sun Microsystems, Inc.
|
||||
@ -226,7 +226,7 @@ dump_line(void)
|
||||
cur_col = 1;
|
||||
++ps.out_lines;
|
||||
}
|
||||
while (e_com > com_st && isspace(e_com[-1]))
|
||||
while (e_com > com_st && isspace((unsigned char)e_com[-1]))
|
||||
e_com--;
|
||||
cur_col = pad_output(cur_col, target);
|
||||
if (!ps.box_com) {
|
||||
@ -590,9 +590,9 @@ parsefont(struct fstate *f, char *s0)
|
||||
int sizedelta = 0;
|
||||
bzero(f, sizeof *f);
|
||||
while (*s) {
|
||||
if (isdigit(*s))
|
||||
if (isdigit((unsigned char)*s))
|
||||
f->size = f->size * 10 + *s - '0';
|
||||
else if (isupper(*s))
|
||||
else if (isupper((unsigned char)*s))
|
||||
if (f->font[0])
|
||||
f->font[1] = *s;
|
||||
else
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: lexi.c,v 1.15 2009/10/27 23:59:39 deraadt Exp $ */
|
||||
/* $OpenBSD: lexi.c,v 1.16 2013/11/26 13:21:17 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -140,13 +140,14 @@ lexi(void)
|
||||
|
||||
/* Scan an alphanumeric token */
|
||||
if (chartype[(int)*buf_ptr] == alphanum ||
|
||||
(buf_ptr[0] == '.' && isdigit(buf_ptr[1]))) {
|
||||
(buf_ptr[0] == '.' && isdigit((unsigned char)buf_ptr[1]))) {
|
||||
/*
|
||||
* we have a character or number
|
||||
*/
|
||||
char *j; /* used for searching thru list of
|
||||
* reserved words */
|
||||
if (isdigit(*buf_ptr) || (buf_ptr[0] == '.' && isdigit(buf_ptr[1]))) {
|
||||
if (isdigit((unsigned char)*buf_ptr) ||
|
||||
(buf_ptr[0] == '.' && isdigit((unsigned char)buf_ptr[1]))) {
|
||||
int seendot = 0,
|
||||
seenexp = 0,
|
||||
seensfx = 0;
|
||||
@ -169,7 +170,7 @@ lexi(void)
|
||||
}
|
||||
CHECK_SIZE_TOKEN;
|
||||
*e_token++ = *buf_ptr++;
|
||||
if (!isdigit(*buf_ptr) && *buf_ptr != '.') {
|
||||
if (!isdigit((unsigned char)*buf_ptr) && *buf_ptr != '.') {
|
||||
if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp)
|
||||
break;
|
||||
else {
|
||||
@ -300,7 +301,8 @@ lexi(void)
|
||||
* token is in fact a declaration keyword -- one that has been
|
||||
* typedefd
|
||||
*/
|
||||
if (((*buf_ptr == '*' && buf_ptr[1] != '=') || isalpha(*buf_ptr) || *buf_ptr == '_')
|
||||
if (((*buf_ptr == '*' && buf_ptr[1] != '=') ||
|
||||
isalpha((unsigned char)*buf_ptr) || *buf_ptr == '_')
|
||||
&& !ps.p_l_follow
|
||||
&& !ps.block_init
|
||||
&& (ps.last_token == rparen || ps.last_token == semicolon ||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: jot.c,v 1.22 2013/11/15 15:47:53 millert Exp $ */
|
||||
/* $OpenBSD: jot.c,v 1.23 2013/11/26 13:21:18 deraadt Exp $ */
|
||||
/* $NetBSD: jot.c,v 1.3 1994/12/02 20:29:43 pk Exp $ */
|
||||
|
||||
/*-
|
||||
@ -337,7 +337,7 @@ getprec(char *s)
|
||||
if (*p == '\0')
|
||||
return (0);
|
||||
for (q = ++p; *p != '\0'; p++)
|
||||
if (!isdigit(*p))
|
||||
if (!isdigit((unsigned char)*p))
|
||||
break;
|
||||
return (p - q);
|
||||
}
|
||||
@ -378,8 +378,8 @@ getformat(void)
|
||||
*/
|
||||
p2 = p++;
|
||||
dot = hash = space = sign = numbers = 0;
|
||||
while (!isalpha(*p)) {
|
||||
if (isdigit(*p)) {
|
||||
while (!isalpha((unsigned char)*p)) {
|
||||
if (isdigit((unsigned char)*p)) {
|
||||
numbers++;
|
||||
p++;
|
||||
} else if ((*p == '#' && !(numbers|dot|sign|space|
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: lastcomm.c,v 1.17 2009/10/27 23:59:39 deraadt Exp $ */
|
||||
/* $OpenBSD: lastcomm.c,v 1.18 2013/11/26 13:19:05 deraadt Exp $ */
|
||||
/* $NetBSD: lastcomm.c,v 1.9 1995/10/22 01:43:42 ghudson Exp $ */
|
||||
|
||||
/*
|
||||
@ -112,7 +112,7 @@ main(int argc, char *argv[])
|
||||
} else
|
||||
for (p = &ab.ac_comm[0];
|
||||
p < &ab.ac_comm[fldsiz(acct, ac_comm)] && *p; ++p)
|
||||
if (!isprint(*p))
|
||||
if (!isprint((unsigned char)*p))
|
||||
*p = '?';
|
||||
if (!*argv || requested(argv, &ab))
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: leave.c,v 1.12 2009/10/27 23:59:39 deraadt Exp $ */
|
||||
/* $OpenBSD: leave.c,v 1.13 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
/* $NetBSD: leave.c,v 1.4 1995/07/03 16:50:13 phil Exp $ */
|
||||
|
||||
/*
|
||||
@ -83,7 +83,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
for (hours = 0; (c = *cp) && c != '\n'; ++cp) {
|
||||
if (!isdigit(c))
|
||||
if (!isdigit((unsigned char)c))
|
||||
usage();
|
||||
hours = hours * 10 + (c - '0');
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: logger.c,v 1.11 2009/10/27 23:59:40 deraadt Exp $ */
|
||||
/* $OpenBSD: logger.c,v 1.12 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
/* $NetBSD: logger.c,v 1.4 1994/12/22 06:27:00 jtc Exp $ */
|
||||
|
||||
/*
|
||||
@ -157,7 +157,7 @@ decode(char *name, CODE *codetab)
|
||||
{
|
||||
CODE *c;
|
||||
|
||||
if (isdigit(*name))
|
||||
if (isdigit((unsigned char)*name))
|
||||
return (atoi(name));
|
||||
|
||||
for (c = codetab; c->c_name; c++)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: look.c,v 1.13 2009/10/27 23:59:40 deraadt Exp $ */
|
||||
/* $OpenBSD: look.c,v 1.14 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
/* $NetBSD: look.c,v 1.7 1995/08/31 22:41:02 jtc Exp $ */
|
||||
|
||||
/*-
|
||||
@ -144,9 +144,9 @@ look(char *string, char *front, char *back)
|
||||
/* Reformat string to avoid doing it multiple times later. */
|
||||
for (readp = writep = string; ch = *readp++;) {
|
||||
if (fflag)
|
||||
ch = FOLD(ch);
|
||||
ch = FOLD((unsigned char)ch);
|
||||
if (dflag)
|
||||
ch = DICT(ch);
|
||||
ch = DICT((unsigned char)ch);
|
||||
if (ch != NO_COMPARE)
|
||||
*(writep++) = ch;
|
||||
}
|
||||
@ -291,9 +291,9 @@ compare(char *s1, char *s2, char *back)
|
||||
for (; *s1 && s2 < back && *s2 != '\n'; ++s1, ++s2) {
|
||||
ch = *s2;
|
||||
if (fflag)
|
||||
ch = FOLD(ch);
|
||||
ch = FOLD((unsigned char)ch);
|
||||
if (dflag)
|
||||
ch = DICT(ch);
|
||||
ch = DICT((unsigned char)ch);
|
||||
|
||||
if (ch == NO_COMPARE) {
|
||||
++s2; /* Ignore character in comparison. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: newsyslog.c,v 1.91 2013/04/05 01:29:07 tedu Exp $ */
|
||||
/* $OpenBSD: newsyslog.c,v 1.92 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2002, 2003 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
@ -569,7 +569,7 @@ parse_file(int *nentries)
|
||||
|
||||
q = parse = missing_field(sob(++parse), errline, lineno);
|
||||
*(parse = son(parse)) = '\0';
|
||||
if (isdigit(*q))
|
||||
if (isdigit((unsigned char)*q))
|
||||
working->size = atoi(q) * 1024;
|
||||
else
|
||||
working->size = -1;
|
||||
@ -939,7 +939,7 @@ sob(char *p)
|
||||
{
|
||||
if (p == NULL)
|
||||
return(p);
|
||||
while (isspace(*p))
|
||||
while (isspace((unsigned char)*p))
|
||||
p++;
|
||||
return (p);
|
||||
}
|
||||
@ -948,7 +948,7 @@ sob(char *p)
|
||||
char *
|
||||
son(char *p)
|
||||
{
|
||||
while (p && *p && !isspace(*p))
|
||||
while (p && *p && !isspace((unsigned char)*p))
|
||||
p++;
|
||||
return (p);
|
||||
}
|
||||
@ -958,7 +958,7 @@ int
|
||||
isnumberstr(char *string)
|
||||
{
|
||||
while (*string) {
|
||||
if (!isdigit(*string++))
|
||||
if (!isdigit((unsigned char)*string++))
|
||||
return (0);
|
||||
}
|
||||
return (1);
|
||||
@ -1193,7 +1193,8 @@ parse8601(char *s)
|
||||
if (*t != '\0') {
|
||||
s = ++t;
|
||||
l = strtol(s, &t, 10);
|
||||
if (l < 0 || l >= INT_MAX || (*t != '\0' && !isspace(*t)))
|
||||
if (l < 0 || l >= INT_MAX ||
|
||||
(*t != '\0' && !isspace((unsigned char)*t)))
|
||||
return (-1);
|
||||
|
||||
switch (t - s) {
|
||||
@ -1303,7 +1304,7 @@ parseDWM(char *s)
|
||||
return (-1);
|
||||
WMseen++;
|
||||
s++;
|
||||
if (tolower(*s) == 'l') {
|
||||
if (tolower((unsigned char)*s) == 'l') {
|
||||
tm.tm_mday = nd;
|
||||
s++;
|
||||
t = s;
|
||||
@ -1325,7 +1326,7 @@ parseDWM(char *s)
|
||||
break;
|
||||
}
|
||||
|
||||
if (*t == '\0' || isspace(*t))
|
||||
if (*t == '\0' || isspace((unsigned char)*t))
|
||||
break;
|
||||
else
|
||||
s = t;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: elf.c,v 1.22 2013/11/13 06:37:24 deraadt Exp $ */
|
||||
/* $OpenBSD: elf.c,v 1.23 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003 Michael Shalayeff
|
||||
@ -411,7 +411,7 @@ elf2nlist(Elf_Sym *sym, Elf_Ehdr *eh, Elf_Shdr *shdr, char *shstr, struct nlist
|
||||
if (np->n_type != N_UNDF && ELF_ST_BIND(sym->st_info) != STB_LOCAL) {
|
||||
np->n_type |= N_EXT;
|
||||
if (np->n_other)
|
||||
np->n_other = toupper(np->n_other);
|
||||
np->n_other = toupper((unsigned char)np->n_other);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: nm.c,v 1.39 2013/11/12 19:37:39 deraadt Exp $ */
|
||||
/* $OpenBSD: nm.c,v 1.40 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
/* $NetBSD: nm.c,v 1.7 1996/01/14 23:04:03 pk Exp $ */
|
||||
|
||||
/*
|
||||
@ -308,7 +308,7 @@ mmbr_name(struct ar_hdr *arh, char **name, int baselen, int *namelen, FILE *fp)
|
||||
if ((arh->ar_name[0] == '#') &&
|
||||
(arh->ar_name[1] == '1') &&
|
||||
(arh->ar_name[2] == '/') &&
|
||||
(isdigit(arh->ar_name[3]))) {
|
||||
(isdigit((unsigned char)arh->ar_name[3]))) {
|
||||
int len = atoi(&arh->ar_name[3]);
|
||||
|
||||
if (len > *namelen) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: backupfile.c,v 1.20 2009/10/27 23:59:41 deraadt Exp $ */
|
||||
/* $OpenBSD: backupfile.c,v 1.21 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* backupfile.c -- make Emacs style backup file names Copyright (C) 1990 Free
|
||||
@ -132,8 +132,9 @@ version_number(const char *base, const char *backup, size_t base_length)
|
||||
const char *p;
|
||||
|
||||
version = 0;
|
||||
if (!strncmp(base, backup, base_length) && ISDIGIT(backup[base_length])) {
|
||||
for (p = &backup[base_length]; ISDIGIT(*p); ++p)
|
||||
if (!strncmp(base, backup, base_length) &&
|
||||
ISDIGIT((unsigned char)backup[base_length])) {
|
||||
for (p = &backup[base_length]; ISDIGIT((unsigned char)*p); ++p)
|
||||
version = version * 10 + *p - '0';
|
||||
if (p[0] != '~' || p[1])
|
||||
version = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: inp.c,v 1.36 2012/04/10 14:46:34 ajacoutot Exp $ */
|
||||
/* $OpenBSD: inp.c,v 1.37 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* patch - a program to apply diffs to original files
|
||||
@ -461,11 +461,12 @@ rev_in_string(const char *string)
|
||||
if (revision == NULL)
|
||||
return true;
|
||||
patlen = strlen(revision);
|
||||
if (strnEQ(string, revision, patlen) && isspace(string[patlen]))
|
||||
if (strnEQ(string, revision, patlen) &&
|
||||
isspace((unsigned char)string[patlen]))
|
||||
return true;
|
||||
for (s = string; *s; s++) {
|
||||
if (isspace(*s) && strnEQ(s + 1, revision, patlen) &&
|
||||
isspace(s[patlen + 1])) {
|
||||
if (isspace((unsigned char)*s) && strnEQ(s + 1, revision, patlen) &&
|
||||
isspace((unsigned char)s[patlen + 1])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $ */
|
||||
/* $OpenBSD: patch.c,v 1.51 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* patch - a program to apply diffs to original files
|
||||
@ -508,7 +508,7 @@ get_some_switches(void)
|
||||
break;
|
||||
case 'D':
|
||||
do_defines = true;
|
||||
if (!isalpha(*optarg) && *optarg != '_')
|
||||
if (!isalpha((unsigned char)*optarg) && *optarg != '_')
|
||||
fatal("argument to -D is not an identifier\n");
|
||||
snprintf(if_defined, sizeof if_defined,
|
||||
"#ifdef %s\n", optarg);
|
||||
@ -1030,12 +1030,12 @@ static bool
|
||||
similar(const char *a, const char *b, int len)
|
||||
{
|
||||
while (len) {
|
||||
if (isspace(*b)) { /* whitespace (or \n) to match? */
|
||||
if (!isspace(*a)) /* no corresponding whitespace? */
|
||||
return false;
|
||||
while (len && isspace(*b) && *b != '\n')
|
||||
if (isspace((unsigned char)*b)) { /* whitespace (or \n) to match? */
|
||||
if (!isspace((unsigned char)*a))
|
||||
return false; /* no corresponding whitespace */
|
||||
while (len && isspace((unsigned char)*b) && *b != '\n')
|
||||
b++, len--; /* skip pattern whitespace */
|
||||
while (isspace(*a) && *a != '\n')
|
||||
while (isspace((unsigned char)*a) && *a != '\n')
|
||||
a++; /* skip target whitespace */
|
||||
if (*a == '\n' || *b == '\n')
|
||||
return (*a == *b); /* should end in sync */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: pch.c,v 1.40 2013/07/11 12:39:31 otto Exp $ */
|
||||
/* $OpenBSD: pch.c,v 1.41 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* patch - a program to apply diffs to original files
|
||||
@ -283,9 +283,9 @@ intuit_diff_type(void)
|
||||
else
|
||||
indent++;
|
||||
}
|
||||
for (t = s; isdigit(*t) || *t == ','; t++)
|
||||
for (t = s; isdigit((unsigned char)*t) || *t == ','; t++)
|
||||
;
|
||||
this_is_a_command = (isdigit(*s) &&
|
||||
this_is_a_command = (isdigit((unsigned char)*s) &&
|
||||
(*t == 'd' || *t == 'c' || *t == 'a'));
|
||||
if (first_command_line < 0L && this_is_a_command) {
|
||||
first_command_line = this_line;
|
||||
@ -306,10 +306,11 @@ intuit_diff_type(void)
|
||||
names[INDEX_FILE].path = fetchname(s + 6,
|
||||
&names[INDEX_FILE].exists, strippath);
|
||||
else if (strnEQ(s, "Prereq:", 7)) {
|
||||
for (t = s + 7; isspace(*t); t++)
|
||||
for (t = s + 7; isspace((unsigned char)*t); t++)
|
||||
;
|
||||
revision = savestr(t);
|
||||
for (t = revision; *t && !isspace(*t); t++)
|
||||
for (t = revision;
|
||||
*t && !isspace((unsigned char)*t); t++)
|
||||
;
|
||||
*t = '\0';
|
||||
if (*revision == '\0') {
|
||||
@ -567,17 +568,18 @@ another_hunk(void)
|
||||
p_end--;
|
||||
return false;
|
||||
}
|
||||
for (s = buf; *s && !isdigit(*s); s++)
|
||||
for (s = buf;
|
||||
*s && !isdigit((unsigned char)*s); s++)
|
||||
;
|
||||
if (!*s)
|
||||
malformed();
|
||||
if (strnEQ(s, "0,0", 3))
|
||||
memmove(s, s + 2, strlen(s + 2) + 1);
|
||||
p_first = (LINENUM) atol(s);
|
||||
while (isdigit(*s))
|
||||
while (isdigit((unsigned char)*s))
|
||||
s++;
|
||||
if (*s == ',') {
|
||||
for (; *s && !isdigit(*s); s++)
|
||||
for (; *s && !isdigit((unsigned char)*s); s++)
|
||||
;
|
||||
if (!*s)
|
||||
malformed();
|
||||
@ -636,15 +638,16 @@ another_hunk(void)
|
||||
return false;
|
||||
}
|
||||
p_char[p_end] = '=';
|
||||
for (s = buf; *s && !isdigit(*s); s++)
|
||||
for (s = buf;
|
||||
*s && !isdigit((unsigned char)*s); s++)
|
||||
;
|
||||
if (!*s)
|
||||
malformed();
|
||||
p_newfirst = (LINENUM) atol(s);
|
||||
while (isdigit(*s))
|
||||
while (isdigit((unsigned char)*s))
|
||||
s++;
|
||||
if (*s == ',') {
|
||||
for (; *s && !isdigit(*s); s++)
|
||||
for (; *s && !isdigit((unsigned char)*s); s++)
|
||||
;
|
||||
if (!*s)
|
||||
malformed();
|
||||
@ -674,8 +677,8 @@ another_hunk(void)
|
||||
change_line:
|
||||
if (buf[1] == '\n' && canonicalize)
|
||||
strlcpy(buf + 1, " \n", sizeof buf - 1);
|
||||
if (!isspace(buf[1]) && buf[1] != '>' &&
|
||||
buf[1] != '<' &&
|
||||
if (!isspace((unsigned char)buf[1]) &&
|
||||
buf[1] != '>' && buf[1] != '<' &&
|
||||
repl_beginning && repl_could_be_missing) {
|
||||
repl_missing = true;
|
||||
goto hunk_done;
|
||||
@ -721,7 +724,7 @@ another_hunk(void)
|
||||
}
|
||||
break;
|
||||
case ' ':
|
||||
if (!isspace(buf[1]) &&
|
||||
if (!isspace((unsigned char)buf[1]) &&
|
||||
repl_beginning && repl_could_be_missing) {
|
||||
repl_missing = true;
|
||||
goto hunk_done;
|
||||
@ -849,11 +852,11 @@ hunk_done:
|
||||
if (!*s)
|
||||
malformed();
|
||||
p_first = (LINENUM) atol(s);
|
||||
while (isdigit(*s))
|
||||
while (isdigit((unsigned char)*s))
|
||||
s++;
|
||||
if (*s == ',') {
|
||||
p_ptrn_lines = (LINENUM) atol(++s);
|
||||
while (isdigit(*s))
|
||||
while (isdigit((unsigned char)*s))
|
||||
s++;
|
||||
} else
|
||||
p_ptrn_lines = 1;
|
||||
@ -862,11 +865,11 @@ hunk_done:
|
||||
if (*s != '+' || !*++s)
|
||||
malformed();
|
||||
p_newfirst = (LINENUM) atol(s);
|
||||
while (isdigit(*s))
|
||||
while (isdigit((unsigned char)*s))
|
||||
s++;
|
||||
if (*s == ',') {
|
||||
p_repl_lines = (LINENUM) atol(++s);
|
||||
while (isdigit(*s))
|
||||
while (isdigit((unsigned char)*s))
|
||||
s++;
|
||||
} else
|
||||
p_repl_lines = 1;
|
||||
@ -1009,16 +1012,16 @@ hunk_done:
|
||||
p_context = 0;
|
||||
ret = pgets(buf, sizeof buf, pfp);
|
||||
p_input_line++;
|
||||
if (ret == NULL || !isdigit(*buf)) {
|
||||
if (ret == NULL || !isdigit((unsigned char)*buf)) {
|
||||
next_intuit_at(line_beginning, p_input_line);
|
||||
return false;
|
||||
}
|
||||
p_first = (LINENUM) atol(buf);
|
||||
for (s = buf; isdigit(*s); s++)
|
||||
for (s = buf; isdigit((unsigned char)*s); s++)
|
||||
;
|
||||
if (*s == ',') {
|
||||
p_ptrn_lines = (LINENUM) atol(++s) - p_first + 1;
|
||||
while (isdigit(*s))
|
||||
while (isdigit((unsigned char)*s))
|
||||
s++;
|
||||
} else
|
||||
p_ptrn_lines = (*s != 'a');
|
||||
@ -1026,7 +1029,7 @@ hunk_done:
|
||||
if (hunk_type == 'a')
|
||||
p_first++; /* do append rather than insert */
|
||||
min = (LINENUM) atol(++s);
|
||||
for (; isdigit(*s); s++)
|
||||
for (; isdigit((unsigned char)*s); s++)
|
||||
;
|
||||
if (*s == ',')
|
||||
max = (LINENUM) atol(++s);
|
||||
@ -1383,11 +1386,11 @@ do_ed_script(void)
|
||||
break;
|
||||
}
|
||||
p_input_line++;
|
||||
for (t = buf; isdigit(*t) || *t == ','; t++)
|
||||
for (t = buf; isdigit((unsigned char)*t) || *t == ','; t++)
|
||||
;
|
||||
/* POSIX defines allowed commands as {a,c,d,i,s} */
|
||||
if (isdigit(*buf) && (*t == 'a' || *t == 'c' || *t == 'd' ||
|
||||
*t == 'i' || *t == 's')) {
|
||||
if (isdigit((unsigned char)*buf) &&
|
||||
(*t == 'a' || *t == 'c' || *t == 'd' || *t == 'i' || *t == 's')) {
|
||||
if (pipefp != NULL)
|
||||
fputs(buf, pipefp);
|
||||
if (*t != 'd') {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: util.c,v 1.35 2010/07/24 01:10:12 ray Exp $ */
|
||||
/* $OpenBSD: util.c,v 1.36 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* patch - a program to apply diffs to original files
|
||||
@ -129,10 +129,10 @@ backup_file(const char *orig)
|
||||
while (stat(bakname, &filestat) == 0 &&
|
||||
orig_device == filestat.st_dev && orig_inode == filestat.st_ino) {
|
||||
/* Skip initial non-lowercase chars. */
|
||||
for (s = simplename; *s && !islower(*s); s++)
|
||||
for (s = simplename; *s && !islower((unsigned char)*s); s++)
|
||||
;
|
||||
if (*s)
|
||||
*s = toupper(*s);
|
||||
*s = toupper((unsigned char)*s);
|
||||
else
|
||||
memmove(simplename, simplename + 1,
|
||||
strlen(simplename + 1) + 1);
|
||||
@ -333,7 +333,7 @@ fetchname(const char *at, bool *exists, int strip_leading)
|
||||
|
||||
if (at == NULL || *at == '\0')
|
||||
return NULL;
|
||||
while (isspace(*at))
|
||||
while (isspace((unsigned char)*at))
|
||||
at++;
|
||||
#ifdef DEBUGGING
|
||||
if (debug & 128)
|
||||
@ -347,7 +347,7 @@ fetchname(const char *at, bool *exists, int strip_leading)
|
||||
tab = strchr(t, '\t') != NULL;
|
||||
/* Strip off up to `strip_leading' path components and NUL terminate. */
|
||||
for (sleading = strip_leading; *t != '\0' && ((tab && *t != '\t') ||
|
||||
!isspace(*t)); t++) {
|
||||
!isspace((unsigned char)*t)); t++) {
|
||||
if (t[0] == '/' && t[1] != '/' && t[1] != '\0')
|
||||
if (--sleading >= 0)
|
||||
name = t + 1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: egetopt.c,v 1.8 2009/10/27 23:59:41 deraadt Exp $ */
|
||||
/* $OpenBSD: egetopt.c,v 1.9 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991 Keith Muller.
|
||||
@ -106,14 +106,14 @@ egetopt(int nargc, char * const *nargv, const char *ostr)
|
||||
*/
|
||||
if ((eoptopt == (int)'-') && !*place)
|
||||
return (-1);
|
||||
if (strchr(ostr, '#') && (isdigit(eoptopt) ||
|
||||
if (strchr(ostr, '#') && (isdigit((unsigned char)eoptopt) ||
|
||||
(((eoptopt == (int)'-') || (eoptopt == (int)'+')) &&
|
||||
isdigit(*place)))) {
|
||||
isdigit((unsigned char)*place)))) {
|
||||
/*
|
||||
* # option: +/- with a number is ok
|
||||
*/
|
||||
for (p = place; *p != '\0'; ++p) {
|
||||
if (!isdigit(*p))
|
||||
if (!isdigit((unsigned char)*p))
|
||||
break;
|
||||
}
|
||||
eoptarg = place-1;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: pr.c,v 1.32 2013/08/22 04:43:40 guenther Exp $ */
|
||||
/* $OpenBSD: pr.c,v 1.33 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991 Keith Muller.
|
||||
@ -1808,11 +1808,11 @@ setup(int argc, char *argv[])
|
||||
break;
|
||||
case 'e':
|
||||
++eflag;
|
||||
if ((eoptarg != NULL) && !isdigit(*eoptarg))
|
||||
if ((eoptarg != NULL) && !isdigit((unsigned char)*eoptarg))
|
||||
inchar = *eoptarg++;
|
||||
else
|
||||
inchar = INCHAR;
|
||||
if ((eoptarg != NULL) && isdigit(*eoptarg)) {
|
||||
if ((eoptarg != NULL) && isdigit((unsigned char)*eoptarg)) {
|
||||
ingap = strtonum(eoptarg, 0, INT_MAX, &errstr);
|
||||
if (errstr) {
|
||||
ferrout("pr: -e gap is %s: %s\n", errstr, eoptarg);
|
||||
@ -1835,11 +1835,11 @@ setup(int argc, char *argv[])
|
||||
break;
|
||||
case 'i':
|
||||
++iflag;
|
||||
if ((eoptarg != NULL) && !isdigit(*eoptarg))
|
||||
if ((eoptarg != NULL) && !isdigit((unsigned char)*eoptarg))
|
||||
ochar = *eoptarg++;
|
||||
else
|
||||
ochar = OCHAR;
|
||||
if ((eoptarg != NULL) && isdigit(*eoptarg)) {
|
||||
if ((eoptarg != NULL) && isdigit((unsigned char)*eoptarg)) {
|
||||
ogap = strtonum(eoptarg, 0, INT_MAX, &errstr);
|
||||
if (errstr) {
|
||||
ferrout("pr: -i gap is %s: %s\n", errstr, eoptarg);
|
||||
@ -1864,11 +1864,11 @@ setup(int argc, char *argv[])
|
||||
++merge;
|
||||
break;
|
||||
case 'n':
|
||||
if ((eoptarg != NULL) && !isdigit(*eoptarg))
|
||||
if ((eoptarg != NULL) && !isdigit((unsigned char)*eoptarg))
|
||||
nmchar = *eoptarg++;
|
||||
else
|
||||
nmchar = NMCHAR;
|
||||
if ((eoptarg != NULL) && isdigit(*eoptarg)) {
|
||||
if ((eoptarg != NULL) && isdigit((unsigned char)*eoptarg)) {
|
||||
nmwd = strtonum(eoptarg, 1, INT_MAX, &errstr);
|
||||
if (errstr) {
|
||||
ferrout("pr: -n width is %s: %s\n", errstr, eoptarg);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: quota.c,v 1.31 2013/11/08 15:21:20 jsing Exp $ */
|
||||
/* $OpenBSD: quota.c,v 1.32 2013/11/26 13:19:07 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1990, 1993
|
||||
@ -684,10 +684,10 @@ alldigits(char *s)
|
||||
{
|
||||
int c;
|
||||
|
||||
c = *s++;
|
||||
c = (unsigned char)*s++;
|
||||
do {
|
||||
if (!isdigit(c))
|
||||
return (0);
|
||||
} while ((c = *s++));
|
||||
} while ((c = (unsigned char)*s++));
|
||||
return (1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user