Source-Changes-HG archive

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

[src/trunk]: src/dist/ipf/lib Add casts to unsigned char for arguments to cty...



details:   https://anonhg.NetBSD.org/src/rev/05a233b10707
branches:  trunk
changeset: 571200:05a233b10707
user:      he <he%NetBSD.org@localhost>
date:      Sat Nov 13 14:36:29 2004 +0000

description:
Add casts to unsigned char for arguments to ctype functions.
Note to be sent to Darren Reed for possible inclusion in master sources.

diffstat:

 dist/ipf/lib/var.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r 00b2efecb832 -r 05a233b10707 dist/ipf/lib/var.c
--- a/dist/ipf/lib/var.c        Sat Nov 13 14:32:14 2004 +0000
+++ b/dist/ipf/lib/var.c        Sat Nov 13 14:36:29 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.1.1.2 2004/07/23 05:34:38 martti Exp $       */
+/*     $NetBSD: var.c,v 1.2 2004/11/13 14:36:29 he Exp $       */
 
 #include <ctype.h>
 
@@ -46,9 +46,10 @@
                        fprintf(stderr, "%d: { without }\n", line);
                        return NULL;
                }
-       } else if (isalpha(*s)) {
+       } else if (isalpha((unsigned char)*s)) {
                for (t = s + 1; *t != '\0'; t++)
-                       if (!isalpha(*t) && !isdigit(*t) && (*t != '_'))
+                       if (!isalpha((unsigned char)*t) && 
+                           !isdigit((unsigned char)*t) && (*t != '_'))
                                break;
        } else {
                fprintf(stderr, "%d: variables cannot start with '%c'\n",



Home | Main Index | Thread Index | Old Index