From 7be0cc2b605c4cd3a82379e35298f48be5655faf Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Thu, 20 Nov 2003 00:25:39 +0000 Subject: [PATCH] cast ctype calls to unsigned char --- src/apprentice.c | 4 ++-- src/ascmagic.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/apprentice.c b/src/apprentice.c index ec9c0e24..50a0c19e 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -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; diff --git a/src/ascmagic.c b/src/ascmagic.c index 6cab46a8..3df6aaae 100644 --- a/src/ascmagic.c +++ b/src/ascmagic.c @@ -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"; -- 2.40.0