]> granicus.if.org Git - file/commitdiff
cast ctype calls to unsigned char
authorChristos Zoulas <christos@zoulas.com>
Thu, 20 Nov 2003 00:25:39 +0000 (00:25 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 20 Nov 2003 00:25:39 +0000 (00:25 +0000)
src/apprentice.c
src/ascmagic.c

index ec9c0e24b51a38f9b00a23f5c4f714e5aee7fa8b..50a0c19e77cb5118c3c8e12f3ebffb9f1a9842b9 100644 (file)
@@ -50,7 +50,7 @@
 #endif
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: apprentice.c,v 1.70 2003/10/16 19:26:57 christos Exp $")
+FILE_RCSID("@(#)$Id: apprentice.c,v 1.71 2003/11/20 00:25:39 christos Exp $")
 #endif /* lint */
 
 #define        EATAB {while (isascii((unsigned char) *l) && \
@@ -614,7 +614,7 @@ parse(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp, char *l,
                        eatsize(&l);
                } else {
                        m->mask = 0L;
-                       while (!isspace(*++l)) {
+                       while (!isspace((unsigned char)*++l)) {
                                switch (*l) {
                                case CHAR_IGNORE_LOWERCASE:
                                        m->mask |= STRING_IGNORE_LOWERCASE;
index 6cab46a805607ad2ef623f4154bf5c234c6a5d02..3df6aaae7e35c165a4925bdcc2558ce9e2e24fad 100644 (file)
@@ -54,7 +54,7 @@
 #include "names.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: ascmagic.c,v 1.39 2003/11/11 20:01:45 christos Exp $")
+FILE_RCSID("@(#)$Id: ascmagic.c,v 1.40 2003/11/20 00:25:39 christos Exp $")
 #endif /* lint */
 
 typedef unsigned long unichar;
@@ -170,8 +170,10 @@ file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes)
                while (ISSPC(*tp))
                        ++tp;   /* skip leading whitespace */
                if ((tp[0] == '\\' && tp[1] == '\"') ||
-                   (isascii(tp[0]) && isalnum(tp[0]) &&
-                    isascii(tp[1]) && isalnum(tp[1]) &&
+                   (isascii((unsigned char)tp[0]) &&
+                    isalnum((unsigned char)tp[0]) &&
+                    isascii((unsigned char)tp[1]) &&
+                    isalnum((unsigned char)tp[1]) &&
                     ISSPC(tp[2]))) {
                        subtype_mime = "text/troff";
                        subtype = "troff or preprocessor input";