Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add (unsigned char) cast to ctype functions



details:   https://anonhg.NetBSD.org/src/rev/ef8f59b6addd
branches:  trunk
changeset: 570832:ef8f59b6addd
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Oct 30 15:51:20 2004 +0000

description:
Add (unsigned char) cast to ctype functions

diffstat:

 usr.bin/apropos/apropos.c                 |   6 +++---
 usr.sbin/sushi/scanform.c                 |   6 +++---
 usr.sbin/sushi/sushi.c                    |  10 +++++-----
 usr.sbin/syslogd/syslogd.c                |  18 +++++++++---------
 usr.sbin/timed/timedc/timedc.c            |   8 ++++----
 usr.sbin/wsmuxctl/wsmuxctl.c              |   4 ++--
 usr.sbin/ypbind/ypbind.c                  |   6 +++---
 usr.sbin/ypserv/common/yplib_host.c       |   6 +++---
 usr.sbin/ypserv/makedbm/makedbm.c         |  14 +++++++-------
 usr.sbin/ypserv/mkalias/mkalias.c         |   6 +++---
 usr.sbin/ypserv/mknetid/mknetid.c         |  16 ++++++++--------
 usr.sbin/ypserv/revnetgroup/revnetgroup.c |   8 ++++----
 usr.sbin/ypserv/stdhosts/stdhosts.c       |   8 ++++----
 usr.sbin/ypserv/yppush/yppush.c           |   4 ++--
 14 files changed, 60 insertions(+), 60 deletions(-)

diffs (truncated from 455 to 300 lines):

diff -r 62a0e308755e -r ef8f59b6addd usr.bin/apropos/apropos.c
--- a/usr.bin/apropos/apropos.c Sat Oct 30 15:39:39 2004 +0000
+++ b/usr.bin/apropos/apropos.c Sat Oct 30 15:51:20 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apropos.c,v 1.23 2004/01/05 23:23:34 jmmv Exp $        */
+/*     $NetBSD: apropos.c,v 1.24 2004/10/30 16:10:46 dsl Exp $ */
 
 /*
  * Copyright (c) 1987, 1993, 1994
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)apropos.c  8.8 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: apropos.c,v 1.23 2004/01/05 23:23:34 jmmv Exp $");
+__RCSID("$NetBSD: apropos.c,v 1.24 2004/10/30 16:10:46 dsl Exp $");
 #endif
 #endif /* not lint */
 
@@ -223,7 +223,7 @@
        char ch;
 
        while ((ch = *from++) && ch != '\n')
-               *to++ = isupper((unsigned char)ch) ? tolower(ch) : ch;
+               *to++ = tolower((unsigned char)ch);
        *to = '\0';
 }
 
diff -r 62a0e308755e -r ef8f59b6addd usr.sbin/sushi/scanform.c
--- a/usr.sbin/sushi/scanform.c Sat Oct 30 15:39:39 2004 +0000
+++ b/usr.sbin/sushi/scanform.c Sat Oct 30 15:51:20 2004 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: scanform.c,v 1.39 2004/04/05 10:25:12 wiz Exp $       */
+/*      $NetBSD: scanform.c,v 1.40 2004/10/30 15:51:20 dsl Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -818,7 +818,7 @@
                                args[i] = strdup(field_buffer(f[lcnt], 0));
                        if (args[i] != NULL) {
                                p = &args[i][strlen(args[i]) - 1];
-                               while(isspace(*p))
+                               while(isspace((unsigned char)*p))
                                        *p-- = '\0';
                        }
                        i++;
@@ -940,7 +940,7 @@
                                args[i] = strdup(field_buffer(f[lcnt], 0));
                        if (args[i] != NULL) {
                                p = &args[i][strlen(args[i]) - 1];
-                               while(isspace(*p))
+                               while(isspace((unsigned char)*p))
                                        *p-- = '\0';
                        }
                        i++;
diff -r 62a0e308755e -r ef8f59b6addd usr.sbin/sushi/sushi.c
--- a/usr.sbin/sushi/sushi.c    Sat Oct 30 15:39:39 2004 +0000
+++ b/usr.sbin/sushi/sushi.c    Sat Oct 30 15:51:20 2004 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: sushi.c,v 1.18 2004/03/24 19:10:58 garbled Exp $       */
+/*      $NetBSD: sushi.c,v 1.19 2004/10/30 15:51:20 dsl Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -153,14 +153,14 @@
 static chtype
 parse_keybinding(char *key)
 {
-       if (tolower(key[0]) == 'f' && isdigit(key[1]))
+       if (tolower((unsigned char)key[0]) == 'f' && isdigit((unsigned char)key[1]))
                /* we have an F key */
                return(KEY_F(atoi(key + 1)));
        else if (key[0] == '^')
-               return((chtype)(toupper(key[1]) & ~0x40));
-       else if (isalpha(key[0]))
+               return((chtype)(toupper((unsigned char)key[1]) & ~0x40));
+       else if (isalpha((unsigned char)key[0]))
                /* we have an insane user */
-               return((chtype)tolower(key[0]));
+               return((chtype)tolower((unsigned char)key[0]));
 
        bailout("%s: %s", catgets(catalog, 1, 20, "Bad keybinding"), key);
        /* NOTREACHED */
diff -r 62a0e308755e -r ef8f59b6addd usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c        Sat Oct 30 15:39:39 2004 +0000
+++ b/usr.sbin/syslogd/syslogd.c        Sat Oct 30 15:51:20 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: syslogd.c,v 1.68 2004/10/28 20:04:24 heas Exp $        */
+/*     $NetBSD: syslogd.c,v 1.69 2004/10/30 15:53:25 dsl Exp $ */
 
 /*
  * Copyright (c) 1983, 1988, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)syslogd.c  8.3 (Berkeley) 4/4/94";
 #else
-__RCSID("$NetBSD: syslogd.c,v 1.68 2004/10/28 20:04:24 heas Exp $");
+__RCSID("$NetBSD: syslogd.c,v 1.69 2004/10/30 15:53:25 dsl Exp $");
 #endif
 #endif /* not lint */
 
@@ -645,7 +645,7 @@
        p = msg;
        if (*p == '<') {
                pri = 0;
-               while (isdigit(*++p))
+               while (isdigit((unsigned char)*++p))
                        pri = 10 * pri + (*p - '0');
                if (*p == '>')
                        ++p;
@@ -698,7 +698,7 @@
                pri = DEFSPRI;
                if (*p == '<') {
                        pri = 0;
-                       while (isdigit(*++p))
+                       while (isdigit((unsigned char)*++p))
                                pri = 10 * pri + (*p - '0');
                        if (*p == '>')
                                ++p;
@@ -1236,11 +1236,11 @@
                 * check for end-of-section, comments, strip off trailing
                 * spaces and newline character.
                 */
-               for (p = cline; isspace(*p); ++p)
+               for (p = cline; isspace((unsigned char)*p); ++p)
                        continue;
                if (*p == '\0' || *p == '#')
                        continue;
-               for (p = strchr(cline, '\0'); isspace(*--p);)
+               for (p = strchr(cline, '\0'); isspace((unsigned char)*--p);)
                        continue;
                *++p = '\0';
                f = (struct filed *)calloc(1, sizeof(*f));
@@ -1499,12 +1499,12 @@
        CODE *c;
        char *p, buf[40];
 
-       if (isdigit(*name))
+       if (isdigit((unsigned char)*name))
                return (atoi(name));
 
        for (p = buf; *name && p < &buf[sizeof(buf) - 1]; p++, name++) {
-               if (isupper(*name))
-                       *p = tolower(*name);
+               if (isupper((unsigned char)*name))
+                       *p = tolower((unsigned char)*name);
                else
                        *p = *name;
        }
diff -r 62a0e308755e -r ef8f59b6addd usr.sbin/timed/timedc/timedc.c
--- a/usr.sbin/timed/timedc/timedc.c    Sat Oct 30 15:39:39 2004 +0000
+++ b/usr.sbin/timed/timedc/timedc.c    Sat Oct 30 15:51:20 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: timedc.c,v 1.11 2003/10/13 06:14:04 itojun Exp $       */
+/*     $NetBSD: timedc.c,v 1.12 2004/10/30 15:54:29 dsl Exp $  */
 
 /*-
  * Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)timedc.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: timedc.c,v 1.11 2003/10/13 06:14:04 itojun Exp $");
+__RCSID("$NetBSD: timedc.c,v 1.12 2004/10/30 15:54:29 dsl Exp $");
 #endif
 #endif /* not lint */
 
@@ -185,13 +185,13 @@
 
        margc = 0;
        for (cp = cmdline; cp < margv[MAX_MARGV - 1] && *cp;) {
-               while (isspace(*cp))
+               while (isspace((unsigned char)*cp))
                        cp++;
                if (*cp == '\0')
                        break;
                *argp++ = cp;
                margc += 1;
-               while (*cp != '\0' && !isspace(*cp))
+               while (*cp != '\0' && !isspace((unsigned char)*cp))
                        cp++;
                if (*cp == '\0')
                        break;
diff -r 62a0e308755e -r ef8f59b6addd usr.sbin/wsmuxctl/wsmuxctl.c
--- a/usr.sbin/wsmuxctl/wsmuxctl.c      Sat Oct 30 15:39:39 2004 +0000
+++ b/usr.sbin/wsmuxctl/wsmuxctl.c      Sat Oct 30 15:51:20 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsmuxctl.c,v 1.8 2004/01/05 23:23:39 jmmv Exp $ */
+/* $NetBSD: wsmuxctl.c,v 1.9 2004/10/30 15:55:28 dsl Exp $ */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -157,7 +157,7 @@
 
        wsfd = open(wsdev, O_WRONLY, 0);
        if (wsfd < 0) {
-               if (isdigit(wsdev[0])) {
+               if (isdigit((unsigned char)wsdev[0])) {
                        snprintf(buf, sizeof(buf), "%s%s", ctlpath, wsdev);
                        wsdev = buf;
                        wsfd = open(wsdev, O_WRONLY, 0);
diff -r 62a0e308755e -r ef8f59b6addd usr.sbin/ypbind/ypbind.c
--- a/usr.sbin/ypbind/ypbind.c  Sat Oct 30 15:39:39 2004 +0000
+++ b/usr.sbin/ypbind/ypbind.c  Sat Oct 30 15:51:20 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ypbind.c,v 1.52 2004/09/07 13:20:40 jrf Exp $  */
+/*     $NetBSD: ypbind.c,v 1.53 2004/10/30 15:57:43 dsl Exp $  */
 
 /*
  * Copyright (c) 1992, 1993 Theo de Raadt <deraadt%fsa.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef LINT
-__RCSID("$NetBSD: ypbind.c,v 1.52 2004/09/07 13:20:40 jrf Exp $");
+__RCSID("$NetBSD: ypbind.c,v 1.53 2004/10/30 15:57:43 dsl Exp $");
 #endif
 
 #include <sys/param.h>
@@ -880,7 +880,7 @@
                }
                *p = '\0';
                p = line;
-               while (isspace(*p))
+               while (isspace((unsigned char)*p))
                        p++;
                if (*p == '#')
                        continue;
diff -r 62a0e308755e -r ef8f59b6addd usr.sbin/ypserv/common/yplib_host.c
--- a/usr.sbin/ypserv/common/yplib_host.c       Sat Oct 30 15:39:39 2004 +0000
+++ b/usr.sbin/ypserv/common/yplib_host.c       Sat Oct 30 15:51:20 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: yplib_host.c,v 1.6 2003/12/10 12:06:26 agc Exp $       */
+/*     $NetBSD: yplib_host.c,v 1.7 2004/10/30 16:01:48 dsl Exp $       */
 
 /*
  * Copyright (c) 1992, 1993 Theo de Raadt <deraadt%theos.com@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: yplib_host.c,v 1.6 2003/12/10 12:06:26 agc Exp $");
+__RCSID("$NetBSD: yplib_host.c,v 1.7 2004/10/30 16:01:48 dsl Exp $");
 #endif
 
 #include <sys/param.h>
@@ -75,7 +75,7 @@
                rsrv_sin.sin_port = htons(port);
        }
 
-       if (isdigit(*server)) {
+       if (isdigit((unsigned char)*server)) {
                if (inet_aton(server,&rsrv_sin.sin_addr) == 0) {
                        errx(1, "invalid IP address `%s'", server);
                }
diff -r 62a0e308755e -r ef8f59b6addd usr.sbin/ypserv/makedbm/makedbm.c
--- a/usr.sbin/ypserv/makedbm/makedbm.c Sat Oct 30 15:39:39 2004 +0000
+++ b/usr.sbin/ypserv/makedbm/makedbm.c Sat Oct 30 15:51:20 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: makedbm.c,v 1.19 2002/11/30 03:10:58 lukem Exp $       */
+/*     $NetBSD: makedbm.c,v 1.20 2004/10/30 16:01:48 dsl Exp $ */
 
 /*
  * Copyright (c) 1994 Mats O Jansson <moj%stacken.kth.se@localhost>
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: makedbm.c,v 1.19 2002/11/30 03:10:58 lukem Exp $");
+__RCSID("$NetBSD: makedbm.c,v 1.20 2004/10/30 16:01:48 dsl Exp $");
 #endif
 
 #include <sys/param.h>
@@ -285,20 +285,20 @@
            (p = fparseln(data_file, &len, &line_no, NULL, FPARSELN_UNESCALL));
            free(p)) {
                k = p;                          /* set start of key */
-               while (*k && isspace(*k))       /* skip leading whitespace */
+               while (*k && isspace((unsigned char)*k)) /* skip leading whitespace */
                        k++;
 
                if (! *k)
                        continue;
 
                v = k;
-               while (*v && !isspace(*v)) {    /* find leading whitespace */
+               while (*v && !isspace((unsigned char)*v)) {     /* find leading whitespace */
                                /* convert key to lower case if forcing. */
-                       if (lflag && isupper(*v))
-                               *v = tolower(*v);
+                       if (lflag && isupper((unsigned char)*v))
+                               *v = tolower((unsigned char)*v);
                        v++;
                }
-               while (*v && isspace(*v))       /* replace space with <NUL> */
+               while (*v && isspace((unsigned char)*v))        /* replace space with <NUL> */
                        *v++ = '\0';
 
                if (add_record(new_db, k, v, TRUE)) {    /* save record */
diff -r 62a0e308755e -r ef8f59b6addd usr.sbin/ypserv/mkalias/mkalias.c
--- a/usr.sbin/ypserv/mkalias/mkalias.c Sat Oct 30 15:39:39 2004 +0000



Home | Main Index | Thread Index | Old Index