Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/4d3106eb28eb
branches:  trunk
changeset: 570821:4d3106eb28eb
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Oct 30 08:46:12 2004 +0000

description:
Add (unsigned char) cast to ctype functions

diffstat:

 usr.sbin/map-mbone/mapper.c |   6 +++---
 usr.sbin/mlxctl/dklist.c    |   6 +++---
 usr.sbin/mountd/mountd.c    |  14 +++++++-------
 3 files changed, 13 insertions(+), 13 deletions(-)

diffs (117 lines):

diff -r f1e15c09f47d -r 4d3106eb28eb usr.sbin/map-mbone/mapper.c
--- a/usr.sbin/map-mbone/mapper.c       Sat Oct 30 08:44:25 2004 +0000
+++ b/usr.sbin/map-mbone/mapper.c       Sat Oct 30 08:46:12 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mapper.c,v 1.21 2004/01/05 23:23:38 jmmv Exp $ */
+/*     $NetBSD: mapper.c,v 1.22 2004/10/30 08:46:12 dsl Exp $  */
 
 /* Mapper for connections between MRouteD multicast routers.
  * Written by Pavel Curtis <Pavel%PARC.Xerox.Com@localhost>
@@ -768,7 +768,7 @@
 int get_number(int *var, int deflt, char ***pargv, int *pargc)
 {
     if ((*pargv)[0][2] == '\0') { /* Get the value from the next argument */
-       if (*pargc > 1  &&  isdigit((*pargv)[1][0])) {
+       if (*pargc > 1  &&  isdigit((unsigned char)(*pargv)[1][0])) {
            (*pargv)++, (*pargc)--;
            *var = atoi((*pargv)[0]);
            return 1;
@@ -778,7 +778,7 @@
        } else
            return 0;
     } else {                   /* Get value from the rest of this argument */
-       if (isdigit((*pargv)[0][2])) {
+       if (isdigit((unsigned char)(*pargv)[0][2])) {
            *var = atoi((*pargv)[0] + 2);
            return 1;
        } else {
diff -r f1e15c09f47d -r 4d3106eb28eb usr.sbin/mlxctl/dklist.c
--- a/usr.sbin/mlxctl/dklist.c  Sat Oct 30 08:44:25 2004 +0000
+++ b/usr.sbin/mlxctl/dklist.c  Sat Oct 30 08:46:12 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dklist.c,v 1.4 2002/06/01 23:51:06 lukem Exp $ */
+/*     $NetBSD: dklist.c,v 1.5 2004/10/30 08:47:58 dsl Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
 
 #ifndef lint
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: dklist.c,v 1.4 2002/06/01 23:51:06 lukem Exp $");
+__RCSID("$NetBSD: dklist.c,v 1.5 2004/10/30 08:47:58 dsl Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -146,7 +146,7 @@
        struct mlx_disk *md;
        int unit;
 
-       if (name[0] != 'l' || name[1] != 'd' || !isdigit(name[2]))
+       if (name[0] != 'l' || name[1] != 'd' || !isdigit((unsigned char)name[2]))
                return (-1);
 
        SIMPLEQ_FOREACH(md, &mlx_disks, chain)
diff -r f1e15c09f47d -r 4d3106eb28eb usr.sbin/mountd/mountd.c
--- a/usr.sbin/mountd/mountd.c  Sat Oct 30 08:44:25 2004 +0000
+++ b/usr.sbin/mountd/mountd.c  Sat Oct 30 08:46:12 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mountd.c,v 1.87 2004/04/21 01:05:48 christos Exp $      */
+/*     $NetBSD: mountd.c,v 1.88 2004/10/30 08:49:45 dsl Exp $   */
 
 /*
  * Copyright (c) 1989, 1993
@@ -47,7 +47,7 @@
 #if 0
 static char     sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: mountd.c,v 1.87 2004/04/21 01:05:48 christos Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.88 2004/10/30 08:49:45 dsl Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -2172,7 +2172,7 @@
                sin.sin_len = sizeof sin;
                sin.sin_addr = inet_makeaddr(np->n_net, 0);
                sa = (struct sockaddr *)&sin;
-       } else if (isdigit(*cp)) {
+       } else if (isdigit((unsigned char)*cp)) {
                memset(&hints, 0, sizeof hints);
                hints.ai_family = AF_UNSPEC;
                hints.ai_flags = AI_NUMERICHOST;
@@ -2190,7 +2190,7 @@
                        sa = (struct sockaddr *)&sin;
                } else
                        sa = ai->ai_addr;
-       } else if (isxdigit(*cp) || *cp == ':') {
+       } else if (isxdigit((unsigned char)*cp) || *cp == ':') {
                memset(&hints, 0, sizeof hints);
                hints.ai_family = AF_UNSPEC;
                hints.ai_flags = AI_NUMERICHOST;
@@ -2308,7 +2308,7 @@
         */
        names = strsep(&namelist, " \t\n");
        name = strsep(&names, ":");
-       if (isdigit(*name) || *name == '-')
+       if (isdigit((unsigned char)*name) || *name == '-')
                pw = getpwuid(atoi(name));
        else
                pw = getpwnam(name);
@@ -2339,7 +2339,7 @@
         */
        if (pw != NULL)
                cr->cr_uid = pw->pw_uid;
-       else if (isdigit(*name) || *name == '-')
+       else if (isdigit((unsigned char)*name) || *name == '-')
                cr->cr_uid = atoi(name);
        else {
                syslog(LOG_ERR, "Unknown user: %s", name);
@@ -2348,7 +2348,7 @@
        cr->cr_ngroups = 0;
        while (names != NULL && *names != '\0' && cr->cr_ngroups < NGROUPS) {
                name = strsep(&names, ":");
-               if (isdigit(*name) || *name == '-') {
+               if (isdigit((unsigned char)*name) || *name == '-') {
                        cr->cr_groups[cr->cr_ngroups++] = atoi(name);
                } else {
                        if ((gr = getgrnam(name)) == NULL) {



Home | Main Index | Thread Index | Old Index