PR/21178: Christian Biere: Potential misuse of ctype functions [pppd]

This commit is contained in:
christos 2004-05-13 17:02:32 +00:00
parent 40559f7fcc
commit 18289afe56
3 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: multilink.c,v 1.2 2002/05/29 19:06:32 christos Exp $ */
/* $NetBSD: multilink.c,v 1.3 2004/05/13 17:02:32 christos Exp $ */
/*
* multilink.c - support routines for multilink.
@ -379,7 +379,7 @@ str_to_epdisc(ep, str)
if (*str == 0)
break;
if (p <= str)
for (p = str; isxdigit(*p); ++p)
for (p = str; isxdigit((unsigned char)*p); ++p)
;
i = p - str;
if (i == 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: options.c,v 1.40 2003/05/17 21:00:57 itojun Exp $ */
/* $NetBSD: options.c,v 1.41 2004/05/13 17:02:32 christos Exp $ */
/*
* options.c - handles option processing for PPP.
@ -47,7 +47,7 @@
#if 0
#define RCSID "Id: options.c,v 1.80 2001/03/12 22:56:12 paulus Exp "
#else
__RCSID("$NetBSD: options.c,v 1.40 2003/05/17 21:00:57 itojun Exp $");
__RCSID("$NetBSD: options.c,v 1.41 2004/05/13 17:02:32 christos Exp $");
#endif
#endif
@ -1161,7 +1161,7 @@ getword(f, word, newlinep, filename)
/*
* A non-whitespace character is the start of a word.
*/
if (!isspace(c))
if (!isspace((unsigned char)c))
break;
}
@ -1215,12 +1215,12 @@ getword(f, word, newlinep, filename)
break;
default:
if (isoctal(c)) {
if (isoctal((unsigned char)c)) {
/*
* \ddd octal sequence
*/
value = 0;
for (n = 0; n < 3 && isoctal(c); ++n) {
for (n = 0; n < 3 && isoctal((unsigned char)c); ++n) {
value = (value << 3) + (c & 07);
c = getc(f);
}
@ -1234,7 +1234,7 @@ getword(f, word, newlinep, filename)
*/
value = 0;
c = getc(f);
for (n = 0; n < 2 && isxdigit(c); ++n) {
for (n = 0; n < 2 && isxdigit((unsigned char)c); ++n) {
digit = toupper(c) - '0';
if (digit > 10)
digit += '0' + 10 - 'A';
@ -1272,7 +1272,7 @@ getword(f, word, newlinep, filename)
if (c == quoted)
break;
} else {
if (isspace(c) || c == '#') {
if (isspace((unsigned char)c) || c == '#') {
ungetc (c, f);
break;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: utils.c,v 1.11 2003/05/17 20:49:28 itojun Exp $ */
/* $NetBSD: utils.c,v 1.12 2004/05/13 17:02:33 christos Exp $ */
/*
* utils.c - various utility functions used in pppd.
@ -40,7 +40,7 @@
#if 0
#define RCSID "Id: utils.c,v 1.13 2001/03/16 02:08:13 paulus Exp "
#else
__RCSID("$NetBSD: utils.c,v 1.11 2003/05/17 20:49:28 itojun Exp $");
__RCSID("$NetBSD: utils.c,v 1.12 2004/05/13 17:02:33 christos Exp $");
#endif
#endif
@ -170,7 +170,7 @@ vslprintf(buf, buflen, fmt, args)
width = va_arg(args, int);
c = *++fmt;
} else {
while (isdigit(c)) {
while (isdigit((unsigned char)c)) {
width = width * 10 + c - '0';
c = *++fmt;
}
@ -182,7 +182,7 @@ vslprintf(buf, buflen, fmt, args)
c = *++fmt;
} else {
prec = 0;
while (isdigit(c)) {
while (isdigit((unsigned char)c)) {
prec = prec * 10 + c - '0';
c = *++fmt;
}