Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/5a115eaf98f9
branches:  trunk
changeset: 570822:5a115eaf98f9
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Oct 30 08:54:51 2004 +0000

description:
Add (unsigned char) cast to ctype functions
The argument rules suck.....

diffstat:

 usr.sbin/moused/moused.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (57 lines):

diff -r 4d3106eb28eb -r 5a115eaf98f9 usr.sbin/moused/moused.c
--- a/usr.sbin/moused/moused.c  Sat Oct 30 08:46:12 2004 +0000
+++ b/usr.sbin/moused/moused.c  Sat Oct 30 08:54:51 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: moused.c,v 1.13 2004/04/23 02:58:30 simonb Exp $ */
+/* $NetBSD: moused.c,v 1.14 2004/10/30 08:54:51 dsl Exp $ */
 /**
  ** Copyright (c) 1995 Michael Smith, All rights reserved.
  **
@@ -48,7 +48,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: moused.c,v 1.13 2004/04/23 02:58:30 simonb Exp $");
+__RCSID("$NetBSD: moused.c,v 1.14 2004/10/30 08:54:51 dsl Exp $");
 #endif /* not lint */
 
 #include <ctype.h>
@@ -670,7 +670,7 @@
                rodent.zmap[1] = i + 1;
                debug("optind: %d, optarg: '%s'", optind, optarg);
                for (j = 1; j < 4; ++j) {
-                   if ((optind >= argc) || !isdigit(*argv[optind]))
+                   if ((optind >= argc) || !isdigit((unsigned char)*argv[optind]))
                        break;
                    i = atoi(argv[optind]);
                    if ((i <= 0) || (i > MOUSE_MAXBUTTON - 1)) {
@@ -2022,7 +2022,7 @@
 static char *
 skipspace(char *s)
 {
-    while(isspace(*s))
+    while(isspace((unsigned char)*s))
        ++s;
     return s;
 }
@@ -2037,7 +2037,7 @@
     while (*arg) {
        arg = skipspace(arg);
        s = arg;
-       while (isdigit(*arg))
+       while (isdigit((unsigned char)*arg))
            ++arg;
        arg = skipspace(arg);
        if ((arg <= s) || (*arg != '='))
@@ -2046,9 +2046,9 @@
 
        arg = skipspace(++arg);
        s = arg;
-       while (isdigit(*arg))
+       while (isdigit((unsigned char)*arg))
            ++arg;
-       if ((arg <= s) || (!isspace(*arg) && (*arg != '\0')))
+       if ((arg <= s) || (!isspace((unsigned char)*arg) && (*arg != '\0')))
            return FALSE;
        pbutton = atoi(s);
 



Home | Main Index | Thread Index | Old Index