From 18289afe5699fa2afd7e62dac51b88086b29489e Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 13 May 2004 17:02:32 +0000 Subject: [PATCH] PR/21178: Christian Biere: Potential misuse of ctype functions [pppd] --- usr.sbin/pppd/pppd/multilink.c | 4 ++-- usr.sbin/pppd/pppd/options.c | 14 +++++++------- usr.sbin/pppd/pppd/utils.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/usr.sbin/pppd/pppd/multilink.c b/usr.sbin/pppd/pppd/multilink.c index 0cad9149070d..b79356924843 100644 --- a/usr.sbin/pppd/pppd/multilink.c +++ b/usr.sbin/pppd/pppd/multilink.c @@ -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) diff --git a/usr.sbin/pppd/pppd/options.c b/usr.sbin/pppd/pppd/options.c index 54e732a50fcc..7d89bcf0c64a 100644 --- a/usr.sbin/pppd/pppd/options.c +++ b/usr.sbin/pppd/pppd/options.c @@ -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; } diff --git a/usr.sbin/pppd/pppd/utils.c b/usr.sbin/pppd/pppd/utils.c index 944bcd35424e..02674545c673 100644 --- a/usr.sbin/pppd/pppd/utils.c +++ b/usr.sbin/pppd/pppd/utils.c @@ -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; }