]> diplodocus.org Git - nmh/commitdiff
FINALLY clean up our signed/unsigned character warning mess. In short, we
authorKen Hornstein <kenh@pobox.com>
Wed, 6 Feb 2013 02:00:40 +0000 (21:00 -0500)
committerKen Hornstein <kenh@pobox.com>
Wed, 6 Feb 2013 02:00:40 +0000 (21:00 -0500)
have switched to using "char" almost everywhere, and casting char to
unsigned char when using the ctype macros/functions.

29 files changed:
Makefile.am
configure.ac
h/mf.h
h/mhparse.h
h/mime.h
h/prototypes.h
sbr/dtimep.l
sbr/m_convert.c
sbr/mf.c
sbr/mts.c
sbr/seq_nameok.c
sbr/strcasecmp.c
sbr/trimcpy.c
uip/aliasbr.c
uip/anno.c
uip/distsbr.c
uip/flist.c
uip/mhbuildsbr.c
uip/mhlsbr.c
uip/mhparse.c
uip/msh.c
uip/mshcmds.c
uip/picksbr.c
uip/post.c
uip/replsbr.c
uip/scansbr.c
uip/show.c
uip/slocal.c
uip/sortm.c

index 7e4395e..7d99b68 100644 (file)
@@ -14,7 +14,7 @@ ACLOCAL_AMFLAGS = -I m4
 ## LDADD is included in the program-specific LDADD since we want to add
 ## to this list of libraries, not replace it.
 ##
-LDADD = sbr/libmh.a sbr/libdtimep.a
+LDADD = sbr/libmh.a ##sbr/libdtimep.a
 
 ##
 ## These are used to create the default mhn.defaults config file
@@ -146,7 +146,7 @@ auxexec_SCRIPTS = uip/spost
 ## Internal libraries that we create as part of the build process
 ## but do not install
 ##
-noinst_LIBRARIES = sbr/libmh.a sbr/libdtimep.a mts/libmts.a
+noinst_LIBRARIES = sbr/libmh.a mts/libmts.a
 
 ##
 ## These are all of our header files.  Right now we don't install any of
@@ -486,7 +486,8 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/arglist.c \
                      sbr/context_replace.c sbr/context_save.c \
                      sbr/copy.c sbr/copyip.c sbr/cpydata.c \
                      sbr/cpydgst.c sbr/crawl_folders.c sbr/discard.c \
-                     sbr/done.c sbr/dtime.c sbr/escape_addresses.c \
+                     sbr/done.c sbr/dtimep.l sbr/dtime.c \
+                     sbr/escape_addresses.c \
                      sbr/error.c sbr/ext_hook.c sbr/fdcompare.c \
                      sbr/folder_addmsg.c sbr/folder_delmsgs.c \
                      sbr/folder_free.c sbr/folder_pack.c \
@@ -521,9 +522,9 @@ sbr_libmh_a_CPPFLAGS = -I./sbr -DNMHETCDIR='"$(sysconfdir)"' \
                -DSENDMAILPATH='"$(sendmailpath)"' -DNMHBINDIR='"$(bindir)"' \
                -DNMHLIBDIR='"$(libdir)"'
 
-sbr_libdtimep_a_SOURCES = sbr/dtimep.l
-sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) \
-                        $(DISABLE_SIGN_COMPARE_WARNING)
+##sbr_libdtimep_a_SOURCES = sbr/dtimep.l
+##sbr_libdtimep_a_CFLAGS = $(sbr_libmh_a_CPPFLAGS) \
+##                      $(DISABLE_SIGN_COMPARE_WARNING)
 
 mts_libmts_a_SOURCES = mts/smtp/smtp.c
 
index 06f80dd..978903e 100644 (file)
@@ -146,7 +146,8 @@ AC_CACHE_CHECK([whether compiler supports -Wno-sign-compare],
    CPPFLAGS="$nmh_saved_cppflags"])
 
 if test "$nmh_cv_has_nosigncompare" = 'yes'; then
-  DISABLE_SIGN_COMPARE_WARNING=-Wno-sign-compare
+  dnl DISABLE_SIGN_COMPARE_WARNING=-Wno-sign-compare
+  DISABLE_SIGN_COMPARE_WARNING=
 fi
 AC_SUBST([DISABLE_SIGN_COMPARE_WARNING])dnl
 
@@ -165,7 +166,8 @@ AC_CACHE_CHECK([whether compiler supports -Wno-clobbered], [nmh_cv_has_noclobber
 AC_CACHE_CHECK([whether compiler supports -Wno-pointer-sign], [nmh_cv_has_noptrsign],
 [nmh_saved_cflags="$CFLAGS"
  CFLAGS="$CFLAGS -Wno-pointer-sign -Werror"
- AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=yes,nmh_cv_has_noptrsign=no)
+dnl  AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=yes,nmh_cv_has_noptrsign=no)
+ AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=no,nmh_cv_has_noptrsign=no)
  CFLAGS="$nmh_saved_cflags"])
 
 dnl Can't use -ansi with gcc 4.5.3 on Cygwin, at least through setup
diff --git a/h/mf.h b/h/mf.h
index 6063e60..d3972e8 100644 (file)
--- a/h/mf.h
+++ b/h/mf.h
@@ -71,7 +71,7 @@ struct adrx {
  * prototypes
  */
 int isfrom(char *);
-int lequal (unsigned char *, unsigned char *);
+int lequal (char *, char *);
 int mfgets (FILE *, char **);
 char *legal_person (char *);
 struct adrx *seekadrx (char *);
index 5a5a219..ee19c3e 100644 (file)
@@ -273,7 +273,7 @@ extern struct str2init str2methods[];
 int pidcheck (int);
 CT parse_mime (char *);
 int add_header (CT, char *, char *);
-int get_ctinfo (unsigned char *, CT, int);
+int get_ctinfo (char *, CT, int);
 int params_external (CT, int);
 int open7Bit (CT, char **);
 void close_encoding (CT);
index 3e50ce2..2f8a6a3 100644 (file)
--- a/h/mime.h
+++ b/h/mime.h
@@ -13,7 +13,9 @@
 #define        DISPO_FIELD     "Content-Disposition"
 #define        MD5_FIELD       "Content-MD5"
 
-#define        isatom(c)   (!isspace (c) && !iscntrl (c) && (c) != '(' \
+#define        isatom(c)   (isascii((unsigned char) c) \
+                     && !isspace ((unsigned char) c) \
+                    && !iscntrl ((unsigned char) c) && (c) != '(' \
                     && (c) != ')' && (c) != '<'  && (c) != '>' \
                     && (c) != '@' && (c) != ','  && (c) != ';' \
                     && (c) != ':' && (c) != '\\' && (c) != '"' \
@@ -23,7 +25,9 @@
  * Test for valid characters used in "token"
  * as defined in RFC2045
  */
-#define        istoken(c)  (!isspace (c) && !iscntrl (c) && (c) != '(' \
+#define        istoken(c)  (isascii((unsigned char) c) \
+                     && !isspace ((unsigned char) c) \
+                    && !iscntrl ((unsigned char) c) && (c) != '(' \
                     && (c) != ')' && (c) != '<'  && (c) != '>' \
                     && (c) != '@' && (c) != ','  && (c) != ';' \
                     && (c) != ':' && (c) != '\\' && (c) != '"' \
index 6ca4fbb..376968a 100644 (file)
@@ -123,7 +123,7 @@ int seq_delmsg (struct msgs *, char *, int);
 int seq_delsel (struct msgs *, char *, int, int);
 int seq_getnum (struct msgs *, char *);
 char *seq_list (struct msgs *, char *);
-int seq_nameok (unsigned char *);
+int seq_nameok (char *);
 void seq_print (struct msgs *, char *);
 void seq_printall (struct msgs *);
 void seq_read (struct msgs *);
@@ -136,7 +136,7 @@ int smatch(char *, struct swit *);
 char *snprintb (char *, size_t, unsigned, char *);
 int ssequal (char *, char *);
 int stringdex (char *, char *);
-char *trimcpy (unsigned char *);
+char *trimcpy (char *);
 int unputenv (char *);
 int uprf (char *, char *);
 int vfgets (FILE *, char **);
index 29c4dd0..bae6ac5 100644 (file)
@@ -126,7 +126,7 @@ static int day_map[] = {
                        tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \
                        SKIPA(); }
 #define SETMON()     { cp++; \
-                       tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \
+                       tw.tw_mon = month_map[(((unsigned char) cp[0]) + ((unsigned char) cp[1])) & 0x1f]; \
                       SKIPA(); }
 #define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; \
                       SKIPD(); }
@@ -146,17 +146,17 @@ static int day_map[] = {
                        tw.tw_flags |= TW_SZEXP; \
                        SKIPD(); }
 #define SETDST()     { tw.tw_flags |= TW_DST; }
-#define SKIPD()      { while ( isdigit(*cp++) ) ; \
+#define SKIPD()      { while ( isdigit((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPTOD()    { while ( !isdigit(*cp++) ) ; \
+#define SKIPTOD()    { while ( !isdigit((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPA()      { while ( isalpha(*cp++) ) ; \
+#define SKIPA()      { while ( isalpha((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPTOA()    { while ( !isalpha(*cp++) ) ; \
+#define SKIPTOA()    { while ( !isalpha((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPSP()     { while ( isspace(*cp++) ) ; \
+#define SKIPSP()     { while ( isspace((unsigned char) *cp++) ) ; \
                        --cp; }
-#define SKIPTOSP()   { while ( !isspace(*cp++) ) ; \
+#define SKIPTOSP()   { while ( !isspace((unsigned char) *cp++) ) ; \
                        --cp; }
 
 #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
@@ -230,7 +230,7 @@ nl      [ \t\n()]
   
   YY_BUFFER_STATE lexhandle;
 
-  register unsigned char *cp;
+  char *cp;
   static struct tws tw; 
 
   memset(&tw,0,sizeof(struct tws));
index 496978e..56b6323 100644 (file)
@@ -38,8 +38,7 @@ int
 m_convert (struct msgs *mp, char *name)
 {
     int first, last, found, range, err;
-    unsigned char *bp;
-    char *cp;
+    char *bp, *cp;
 
     /* check if user defined sequence */
     err = attr (mp, cp = name);
@@ -141,7 +140,7 @@ rangerr:
        }
        if ((range = atoi (bp = cp)) == 0)
            goto badlist;
-       while (isdigit (*bp))
+       while (isdigit ((unsigned char) *bp))
            bp++;
        if (*bp)
            goto badelim;
@@ -250,14 +249,14 @@ single:
 static int
 m_conv (struct msgs *mp, char *str, int call)
 {
-    register int i;
-    register unsigned char *cp, *bp;
-    unsigned char buf[16];
+    int i;
+    char *cp, *bp;
+    char buf[16];
 
     convdir = 1;
     cp = bp = str;
-    if (isdigit (*cp)) {
-       while (isdigit (*bp))
+    if (isdigit ((unsigned char) *cp)) {
+       while (isdigit ((unsigned char) *bp))
            bp++;
        delimp = bp;
        i = atoi (cp);
@@ -274,7 +273,7 @@ m_conv (struct msgs *mp, char *str, int call)
 
 #ifdef LOCALE
     /* doesn't enforce lower case */
-    for (bp = buf; (isalpha(*cp) || *cp == '.')
+    for (bp = buf; (isalpha((unsigned char) *cp) || *cp == '.')
            && (bp - buf < (int) sizeof(buf) - 1); )
 #else
     for (bp = buf; ((*cp >= 'a' && *cp <= 'z') || *cp == '.')
@@ -337,9 +336,9 @@ m_conv (struct msgs *mp, char *str, int call)
 static int
 attr (struct msgs *mp, char *cp)
 {
-    register unsigned char *dp;
+    char *dp;
     char *bp = NULL;
-    register int i, j;
+    int i, j;
     int found,
        inverted = 0,
        range = 0,              /* no range */
@@ -359,7 +358,7 @@ attr (struct msgs *mp, char *cp)
 
     convdir = 1;       /* convert direction */
 
-    for (dp = cp; *dp && isalnum(*dp); dp++)
+    for (dp = cp; *dp && isalnum((unsigned char) *dp); dp++)
        continue;
 
     if (*dp == ':') {
@@ -372,7 +371,7 @@ attr (struct msgs *mp, char *cp)
         * seq:first (or)
         * seq:last
         */
-       if (isalpha (*dp)) {
+       if (isalpha ((unsigned char) *dp)) {
            if (!strcmp (dp, "prev")) {
                convdir = -1;
                first = (mp->curmsg > 0) && (mp->curmsg <= mp->hghmsg)
@@ -407,7 +406,7 @@ attr (struct msgs *mp, char *cp)
            }
            if ((range = atoi(dp)) == 0)
                return BADLST;
-           while (isdigit (*dp))
+           while (isdigit ((unsigned char) *dp))
                dp++;
            if (*dp)
                return BADLST;
index fd92e36..975e396 100644 (file)
--- a/sbr/mf.c
+++ b/sbr/mf.c
@@ -16,7 +16,7 @@
  * static prototypes
  */
 static char *getcpy (char *);
-static void compress (char *, unsigned char *);
+static void compress (char *, char *);
 static int isat (char *);
 static int parse_address (void);
 static int phrase (char *);
@@ -55,14 +55,16 @@ isfrom(char *string)
 
 
 int
-lequal (unsigned char *a, unsigned char *b)
+lequal (char *a, char *b)
 {
     for (; *a; a++, b++)
        if (*b == 0)
            return FALSE;
        else {
-           char c1 = islower (*a) ? toupper (*a) : *a;
-           char c2 = islower (*b) ? toupper (*b) : *b;
+           char c1 = islower ((unsigned char) *a) ?
+                                       toupper ((unsigned char) *a) : *a;
+           char c2 = islower ((unsigned char) *b) ?
+                                       toupper ((unsigned char) *b) : *b;
            if (c1 != c2)
                return FALSE;
        }
@@ -131,9 +133,8 @@ seekadrx (char *addrs)
 struct adrx *
 uucpadrx (char *addrs)
 {
-    register unsigned char *cp, *wp, *xp, *yp;
-    register char *zp;
-    register struct adrx *adrxp = &adrxs1;
+    char *cp, *wp, *xp, *yp, *zp;
+    struct adrx *adrxp = &adrxs1;
 
     if (vp == NULL) {
        vp = tp = getcpy (addrs);
@@ -146,7 +147,7 @@ uucpadrx (char *addrs)
            return NULL;
        }
 
-    for (cp = tp; isspace (*cp); cp++)
+    for (cp = tp; isspace ((unsigned char) *cp); cp++)
        continue;
     if (*cp == 0) {
        free (vp);
@@ -157,11 +158,11 @@ uucpadrx (char *addrs)
     if ((wp = strchr(cp, ',')) == NULL) {
        if ((wp = strchr(cp, ' ')) != NULL) {
            xp = wp;
-           while (isspace (*xp))
+           while (isspace ((unsigned char) *xp))
                xp++;
            if (*xp != 0 && isat (--xp)) {
                yp = xp + 4;
-               while (isspace (*yp))
+               while (isspace ((unsigned char) *yp))
                    yp++;
                if (*yp != 0) {
                    if ((zp = strchr(yp, ' ')) != NULL)
@@ -205,13 +206,12 @@ uucpadrx (char *addrs)
 
 
 static void
-compress (char *fp, unsigned char *tp)
+compress (char *fp, char *tp)
 {
-    register char c;
-    register unsigned char *cp;
+    char c, *cp;
 
     for (c = ' ', cp = tp; (*tp = *fp++) != 0;)
-       if (isspace (*tp)) {
+       if (isspace ((unsigned char) *tp)) {
            if (c != ' ')
                *tp++ = c = ' ';
        }
@@ -333,8 +333,8 @@ static int ingrp = 0;
 static int last_lex = LX_END;
 
 static char *dp = NULL;
-static unsigned char *cp = NULL;
-static unsigned char *ap = NULL;
+static char *cp = NULL;
+static char *ap = NULL;
 static char *pers = NULL;
 static char *mbox = NULL;
 static char *host = NULL;
@@ -416,7 +416,7 @@ getadrx (char *addrs)
            }
            break;
        }
-    while (isspace (*ap))
+    while (isspace ((unsigned char) *ap))
        ap++;
     if (cp)
        sprintf (adr, "%.*s", (int)(cp - ap), ap);
@@ -759,8 +759,7 @@ my_lex (char *buffer)
 {
     /* buffer should be at least BUFSIZ bytes long */
     int i, gotat = 0;
-    register unsigned char c;
-    register char *bp;
+    char c, *bp;
 
 /* Add C to the buffer bp. After use of this macro *bp is guaranteed to be within the buffer. */
 #define ADDCHR(C) do { *bp++ = (C); if ((bp - buffer) == (BUFSIZ-1)) goto my_lex_buffull; } while (0)
@@ -772,7 +771,7 @@ my_lex (char *buffer)
 
     gotat = isat (cp);
     c = *cp++;
-    while (isspace (c))
+    while (isspace ((unsigned char) c))
        c = *cp++;
     if (c == 0) {
        cp = NULL;
@@ -862,7 +861,7 @@ my_lex (char *buffer)
        if (c == special[i].lx_chr)
            return (last_lex = special[i].lx_val);
 
-    if (iscntrl (c))
+    if (iscntrl ((unsigned char) c))
        return (last_lex = LX_ERR);
 
     for (;;) {
@@ -871,7 +870,7 @@ my_lex (char *buffer)
        for (i = 0; special[i].lx_chr != 0; i++)
            if (c == special[i].lx_chr)
                goto got_atom;
-       if (iscntrl (c) || isspace (c))
+       if (iscntrl ((unsigned char) c) || isspace ((unsigned char) c))
            break;
        ADDCHR(c);
     }
index bf7d42b..0357828 100644 (file)
--- a/sbr/mts.c
+++ b/sbr/mts.c
@@ -23,7 +23,7 @@
 /*
  * static prototypes
  */
-static char *tailor_value (unsigned char *);
+static char *tailor_value (char *);
 static void getuserinfo (void);
 static const char *get_mtsconf_pathname(void);
 static const char *get_mtsuserconf_pathname(void);
@@ -177,7 +177,7 @@ mts_init (char *name)
  */
 
 static char *
-tailor_value (unsigned char *s)
+tailor_value (char *s)
 {
     int i, r;
     char *bp;
@@ -200,13 +200,13 @@ tailor_value (unsigned char *s)
                    break;
 
                default: 
-                   if (!isdigit (*s)) {
+                   if (!isdigit ((unsigned char) *s)) {
                        *bp++ = QUOTE;
                        *bp = *s;
                    }
-                   r = *s != '0' ? 10 : 8;
-                   for (i = 0; isdigit (*s); s++)
-                       i = i * r + *s - '0';
+                   r = ((unsigned char) *s) != '0' ? 10 : 8;
+                   for (i = 0; isdigit ((unsigned char) *s); s++)
+                       i = i * r + ((unsigned char) *s) - '0';
                    s--;
                    *bp = toascii (i);
                    break;
@@ -359,9 +359,8 @@ getlocalmbox (void)
 static void
 getuserinfo (void)
 {
-    register unsigned char *cp;
-    register char *np;
-    register struct passwd *pw;
+    char *cp, *np;
+    struct passwd *pw;
 
     if ((pw = getpwuid (getuid ())) == NULL
            || pw->pw_name == NULL
@@ -461,8 +460,7 @@ get_mtsuserconf_pathname (void)
 static void
 mts_read_conf_file (FILE *fp)
 {
-    unsigned char *bp;
-    char *cp, buffer[BUFSIZ];
+    char *bp, *cp, buffer[BUFSIZ];
     struct bind *b;
 
     while (fgets (buffer, sizeof(buffer), fp)) {
@@ -474,7 +472,7 @@ mts_read_conf_file (FILE *fp)
        if (!(bp = strchr(buffer, ':')))
            break;
        *bp++ = 0;
-       while (isspace (*bp))
+       while (isspace ((unsigned char) *bp))
            *bp++ = 0;
 
        for (b = binds; b->keyword; b++)
index 6887ac6..328bd5c 100644 (file)
@@ -11,9 +11,9 @@
 
 
 int
-seq_nameok (unsigned char *s)
+seq_nameok (char *s)
 {
-    unsigned char *pp;
+    char *pp;
 
     if (s == NULL || *s == '\0') {
        advise (NULL, "empty sequence name");
@@ -38,7 +38,7 @@ seq_nameok (unsigned char *s)
      * First character in a sequence name must be
      * an alphabetic character ...
      */
-    if (!isalpha (*s)) {
+    if (!isalpha ((unsigned char) *s)) {
        advise (NULL, "illegal sequence name: %s", s);
        return 0;
     }
@@ -47,7 +47,7 @@ seq_nameok (unsigned char *s)
      * and can be followed by zero or more alphanumeric characters
      */
     for (pp = s + 1; *pp; pp++)
-       if (!isalnum (*pp)) {
+       if (!isalnum ((unsigned char) *pp)) {
            advise (NULL, "illegal sequence name: %s", s);
            return 0;
        }
index 04aad7d..c48c9d4 100644 (file)
@@ -24,9 +24,9 @@ mh_strcasecmp (const char *s1, const char *s2)
     us2 = (const unsigned char *) s2;
 
     if (!us1)
-       us1 = "";
+       us1 = (const unsigned char *) "";
     if (!us2)
-       us2 = "";
+       us2 = (const unsigned char *) "";
  
     while (tolower(*us1) == tolower(*us2++)) 
        if (*us1++ == '\0')
index b640ea6..3a2fbd7 100644 (file)
 
 
 char *
-trimcpy (unsigned char *cp)
+trimcpy (char *cp)
 {
-    unsigned char *sp;
+    char *sp;
 
     /* skip over leading whitespace */
-    while (isspace(*cp))
+    while (isspace((unsigned char) *cp))
        cp++;
 
     /* start at the end and zap trailing whitespace */
     for (sp = cp + strlen(cp) - 1; sp >= cp; sp--) {
-       if (isspace(*sp))
+       if (isspace((unsigned char) *sp))
            *sp = '\0';
        else
            break;
@@ -31,7 +31,7 @@ trimcpy (unsigned char *cp)
 
     /* replace remaining whitespace with spaces */
     for (sp = cp; *sp; sp++) {
-       if (isspace(*sp))
+       if (isspace((unsigned char) *sp))
            *sp = ' ';
     }
 
index 4937251..a696e8a 100644 (file)
@@ -35,7 +35,7 @@ char *akerror (int);
 
 static  char *akval (struct aka *, char *);
 static int aleq (char *, char *);
-static char *scanp (unsigned char *);
+static char *scanp (char *);
 static char *getp (char *);
 static char *seekp (char *, char *, char **);
 static int addfile (struct aka *, char *);
@@ -313,9 +313,9 @@ akerror (int i)
 
 
 static char *
-scanp (unsigned char *p)
+scanp (char *p)
 {
-    while (isspace (*p))
+    while (isspace ((unsigned char) *p))
        p++;
     return p;
 }
@@ -324,10 +324,10 @@ scanp (unsigned char *p)
 static char *
 getp (char *p)
 {
-    register unsigned char  *cp = scanp (p);
+    char  *cp = scanp (p);
 
     p = cp;
-    while (!isspace (*cp) && *cp)
+    while (!isspace ((unsigned char) *cp) && *cp)
        cp++;
     *cp = 0;
 
@@ -338,10 +338,10 @@ getp (char *p)
 static char *
 seekp (char *p, char *c, char **a)
 {
-    register unsigned char *cp;
+    char *cp;
 
     p = cp = scanp (p);
-    while (!isspace (*cp) && *cp && *cp != ':' && *cp != ';')
+    while (!isspace ((unsigned char) *cp) && *cp && *cp != ':' && *cp != ';')
        cp++;
     *c = *cp;
     *cp++ = 0;
@@ -456,7 +456,7 @@ addall (struct aka *ak)
 static char *
 getalias (char *addrs)
 {
-    register unsigned char *pp, *qp;
+    char *pp, *qp;
     static char *cp = NULL;
 
     if (cp == NULL)
@@ -466,7 +466,7 @@ getalias (char *addrs)
            return (cp = NULL);
 
     /* Remove leading any space from the address. */
-    for (pp = cp; isspace (*pp); pp++)
+    for (pp = cp; isspace ((unsigned char) *pp); pp++)
        continue;
     if (*pp == 0)
        return (cp = NULL);
@@ -478,7 +478,7 @@ getalias (char *addrs)
        *qp++ = 0;
     for (cp = qp, qp--; qp > pp; qp--)
        if (*qp != 0) {
-           if (isspace (*qp))
+           if (isspace ((unsigned char) *qp))
                *qp = 0;
            else
                break;
index 0ed6e77..cf52021 100644 (file)
@@ -74,7 +74,7 @@ DEFINE_SWITCH_ARRAY(ANNO, switches);
 /*
  * static prototypes
  */
-static void make_comp (unsigned char **);
+static void make_comp (char **);
 
 
 int
@@ -83,8 +83,7 @@ main (int argc, char **argv)
     int inplace = 1, datesw = 1;
     int msgnum;
     char *cp, *maildir;
-    unsigned char *comp = NULL;
-    char *text = NULL, *folder = NULL, buf[BUFSIZ];
+    char *comp = NULL, *text = NULL, *folder = NULL, buf[BUFSIZ];
     char **argp, **arguments;
     struct msgs_array msgs = { 0, 0, NULL };
     struct msgs *mp;
@@ -275,10 +274,9 @@ main (int argc, char **argv)
 }
 
 static void
-make_comp (unsigned char **ap)
+make_comp (char **ap)
 {
-    register unsigned char *cp;
-    char buffer[BUFSIZ];
+    char *cp, buffer[BUFSIZ];
 
     if (*ap == NULL) {
        printf ("Enter component name: ");
@@ -299,6 +297,6 @@ make_comp (unsigned char **ap)
        adios (NULL, "too large component name %s", *ap);
 
     for (cp = *ap; *cp; cp++)
-       if (!isalnum (*cp) && *cp != '-')
+       if (!isalnum ((unsigned char) *cp) && *cp != '-')
            adios (NULL, "invalid component name %s", *ap);
 }
index b5119fb..d7a2712 100644 (file)
@@ -28,8 +28,7 @@ int
 distout (char *drft, char *msgnam, char *backup)
 {
     int state;
-    register unsigned char *dp;
-    register char *resent;
+    char *dp, *resent;
     char name[NAMESZ], buffer[BUFSIZ];
     register FILE *ifp, *ofp;
     m_getfld_state_t gstate = 0;
@@ -74,7 +73,7 @@ distout (char *drft, char *msgnam, char *backup)
 
            case BODY: 
                for (dp = buffer; *dp; dp++)
-                   if (!isspace (*dp)) {
+                   if (!isspace ((unsigned char) *dp)) {
                        advise (NULL, BADTXT, "draft");
                        goto leave_bad;
                    }
index 4c0469e..1444aca 100644 (file)
@@ -277,17 +277,17 @@ main(int argc, char **argv)
 void
 GetFolderOrder(void)
 {
-    unsigned char *p, *s;
+    char *p, *s;
     int priority = 1;
     struct Folder *o;
 
     if (!(p = context_find("Flist-Order")))
        return;
     for (;;) {
-       while (isspace(*p))
+       while (isspace((unsigned char) *p))
            ++p;
        s = p;
-       while (*p && !isspace(*p))
+       while (*p && !isspace((unsigned char) *p))
            ++p;
        if (p != s) {
            /* Found one. */
@@ -390,7 +390,7 @@ void
 BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth)
 {
     char *base, name[PATH_MAX];
-    unsigned char *n;
+    char *n;
     int nlinks;
     DIR *dir;
     struct dirent *dp;
@@ -430,7 +430,7 @@ BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth)
        /* Check to see if the name of the file is a number
         * if it is, we assume it's a mail file and skip it
         */
-       for (n = dp->d_name; *n && isdigit(*n); n++);
+       for (n = dp->d_name; *n && isdigit((unsigned char) *n); n++);
        if (!*n)
            continue;
        strncpy (name, base, sizeof(name) - 2);
index 5954521..ddbbbbe 100644 (file)
@@ -403,8 +403,7 @@ static int
 user_content (FILE *in, char *file, char *buf, CT *ctp)
 {
     int        extrnal, vrsn;
-    unsigned char *cp;
-    char **ap;
+    char *cp, **ap;
     char buffer[BUFSIZ];
     struct multipart *m;
     struct part **pp;
@@ -677,7 +676,7 @@ use_forw:
        if (ci->ci_magic) {
            /* check if specifies command to execute */
            if (*ci->ci_magic == '|' || *ci->ci_magic == '!') {
-               for (cp = ci->ci_magic + 1; isspace (*cp); cp++)
+               for (cp = ci->ci_magic + 1; isspace ((unsigned char) *cp); cp++)
                    continue;
                if (!*cp)
                    adios (NULL, "empty pipe command for #%s directive", ci->ci_type);
@@ -1156,7 +1155,7 @@ scan_content (CT ct)
     int checklinelen = 0, linelen = 0;   /* check for long lines                       */
     int checkboundary = 0, boundaryclash = 0; /* check if clashes with multipart boundary   */
     int checklinespace = 0, linespace = 0;  /* check if any line ends with space          */
-    unsigned char *cp = NULL, buffer[BUFSIZ];
+    char *cp = NULL, buffer[BUFSIZ];
     struct text *t = NULL;
     FILE *in = NULL;
     CE ce = ct->c_cefile;
@@ -1251,7 +1250,7 @@ scan_content (CT ct)
             */
            if (check8bit) {
                for (cp = buffer; *cp; cp++) {
-                   if (!isascii (*cp)) {
+                   if (!isascii ((unsigned char) *cp)) {
                        contains8bit = 1;
                        check8bit = 0;  /* no need to keep checking */
                    }
@@ -1269,7 +1268,7 @@ scan_content (CT ct)
            /*
             * Check if line ends with a space.
             */
-           if (checklinespace && (cp = buffer + strlen (buffer) - 2) > buffer && isspace (*cp)) {
+           if (checklinespace && (cp = buffer + strlen (buffer) - 2) > buffer && isspace ((unsigned char) *cp)) {
                linespace = 1;
                checklinespace = 0;     /* no need to keep checking */
            }
@@ -1280,10 +1279,10 @@ scan_content (CT ct)
             */
            if (checkboundary && buffer[0] == '-' && buffer[1] == '-') {
                for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--)
-                   if (!isspace (*cp))
+                   if (!isspace ((unsigned char) *cp))
                        break;
                *++cp = '\0';
-               if (!strncmp(buffer + 2, prefix, len) && isdigit(buffer[2 + len])) {
+               if (!strncmp(buffer + 2, prefix, len) && isdigit((unsigned char) buffer[2 + len])) {
                    boundaryclash = 1;
                    checkboundary = 0;  /* no need to keep checking */
                }
@@ -1642,7 +1641,8 @@ calculate_digest (CT ct, int asciiP)
     }
 
     /* encode the digest using base64 */
-    for (dp = digest, op = outbuf, cc = sizeof(digest) / sizeof(digest[0]);
+    for (dp = digest, op = (char *) outbuf,
+                               cc = sizeof(digest) / sizeof(digest[0]);
                cc > 0; cc -= 3, op += 4) {
        unsigned long bits;
        char *bp;
index 8f46ebb..c31b93e 100644 (file)
@@ -288,7 +288,7 @@ static unsigned int wid;
 
 static char *ovtxt;
 
-static unsigned char *onelp;
+static char *onelp;
 
 static char *parptr;
 
@@ -1278,7 +1278,7 @@ static void
 putcomp (struct mcomp *c1, struct mcomp *c2, int flag)
 {
     int count, cchdr;
-    unsigned char *cp;
+    char *cp;
 
     cchdr = 0;
     lm = 0;
@@ -1316,8 +1316,8 @@ putcomp (struct mcomp *c1, struct mcomp *c2, int flag)
     if (!(c1->c_flags & HDROUTPUT) && !(c1->c_flags & NOCOMPONENT)) {
         if (c1->c_flags & UPPERCASE)           /* uppercase component also */
            for (cp = (c1->c_text ? c1->c_text : c1->c_name); *cp; cp++)
-               if (islower (*cp))
-                   *cp = toupper (*cp);
+               if (islower ((unsigned char) *cp))
+                   *cp = toupper ((unsigned char) *cp);
        putstr (c1->c_text ? c1->c_text : c1->c_name, c1->c_flags);
        if (flag != BODYCOMP) {
            putstr (": ", c1->c_flags);
@@ -1339,8 +1339,8 @@ putcomp (struct mcomp *c1, struct mcomp *c2, int flag)
            && !(c2->c_flags & NOCOMPONENT)) {
         if (c1->c_flags & UPPERCASE)
            for (cp = c2->c_name; *cp; cp++)
-               if (islower (*cp))
-                   *cp = toupper (*cp);
+               if (islower ((unsigned char) *cp))
+                   *cp = toupper ((unsigned char) *cp);
        putstr (c2->c_name, c1->c_flags);
        putstr (": ", c1->c_flags);
        if (!(c1->c_flags & SPLIT))
@@ -1353,8 +1353,8 @@ putcomp (struct mcomp *c1, struct mcomp *c2, int flag)
     }
     if (c1->c_flags & UPPERCASE)
        for (cp = c2->c_text; *cp; cp++)
-           if (islower (*cp))
-               *cp = toupper (*cp);
+           if (islower ((unsigned char) *cp))
+               *cp = toupper ((unsigned char) *cp);
 
     count = 0;
     if (cchdr) {
@@ -1401,7 +1401,7 @@ oneline (char *stuff, long flags)
     term = 0;
     if (flags & COMPRESS) {
        for (spc = 1, cp = ret; *onelp; onelp++)
-           if (isspace (*onelp)) {
+           if (isspace ((unsigned char) *onelp)) {
                if (*onelp == '\n' && (!onelp[1] || (flags & ADDRFMT))) {
                    term = '\n';
                    *onelp++ = 0;
index 3818876..c09cb1a 100644 (file)
@@ -95,7 +95,7 @@ void free_encoding (CT, int);
  * static prototypes
  */
 static CT get_content (FILE *, char *, int);
-static int get_comment (CT, unsigned char **, int);
+static int get_comment (CT, char **, int);
 
 static int InitGeneric (CT);
 static int InitText (CT);
@@ -335,8 +335,7 @@ get_content (FILE *in, char *file, int toplevel)
        /* Get MIME-Version field */
        if (!mh_strcasecmp (hp->name, VRSN_FIELD)) {
            int ucmp;
-           char c;
-           unsigned char *cp, *dp;
+           char c, *cp, *dp;
 
            if (ct->c_vrsn) {
                advise (NULL, "message %s has multiple %s: fields",
@@ -348,12 +347,12 @@ get_content (FILE *in, char *file, int toplevel)
            /* Now, cleanup this field */
            cp = ct->c_vrsn;
 
-           while (isspace (*cp))
+           while (isspace ((unsigned char) *cp))
                cp++;
            for (dp = strchr(cp, '\n'); dp; dp = strchr(dp, '\n'))
                *dp++ = ' ';
            for (dp = cp + strlen (cp) - 1; dp >= cp; dp--)
-               if (!isspace (*dp))
+               if (!isspace ((unsigned char) *dp))
                    break;
            *++dp = '\0';
            if (debugsw)
@@ -403,8 +402,7 @@ get_content (FILE *in, char *file, int toplevel)
        }
        else if (!mh_strcasecmp (hp->name, ENCODING_FIELD)) {
        /* Get Content-Transfer-Encoding field */
-           char c;
-           unsigned char *cp, *dp;
+           char c, *cp, *dp;
            struct str2init *s2i;
 
            /*
@@ -420,7 +418,7 @@ get_content (FILE *in, char *file, int toplevel)
            /* get copy of this field */
            ct->c_celine = cp = add (hp->value, NULL);
 
-           while (isspace (*cp))
+           while (isspace ((unsigned char) *cp))
                cp++;
            for (dp = cp; istoken (*dp); dp++)
                continue;
@@ -445,8 +443,7 @@ get_content (FILE *in, char *file, int toplevel)
        }
        else if (!mh_strcasecmp (hp->name, MD5_FIELD)) {
        /* Get Content-MD5 field */
-           unsigned char *cp, *dp;
-           char *ep;
+           char *cp, *dp, *ep;
 
            if (!checksw)
                goto next_header;
@@ -459,12 +456,12 @@ get_content (FILE *in, char *file, int toplevel)
 
            ep = cp = add (hp->value, NULL);    /* get a copy */
 
-           while (isspace (*cp))
+           while (isspace ((unsigned char) *cp))
                cp++;
            for (dp = strchr(cp, '\n'); dp; dp = strchr(dp, '\n'))
                *dp++ = ' ';
            for (dp = cp + strlen (cp) - 1; dp >= cp; dp--)
-               if (!isspace (*dp))
+               if (!isspace ((unsigned char) *dp))
                    break;
            *++dp = '\0';
            if (debugsw)
@@ -475,7 +472,7 @@ get_content (FILE *in, char *file, int toplevel)
                goto out;
            }
 
-           for (dp = cp; *dp && !isspace (*dp); dp++)
+           for (dp = cp; *dp && !isspace ((unsigned char) *dp); dp++)
                continue;
            *dp = '\0';
 
@@ -578,7 +575,7 @@ add_header (CT ct, char *name, char *value)
    filename="foo".  If it doesn't and value does, use value from
    that. */
 static char *
-incl_name_value (unsigned char *buf, char *name, char *value) {
+incl_name_value (char *buf, char *name, char *value) {
     char *newbuf = buf;
 
     /* Assume that name is non-null. */
@@ -587,12 +584,11 @@ incl_name_value (unsigned char *buf, char *name, char *value) {
 
        if (! strstr (buf, name_plus_equal)) {
            char *insertion;
-           unsigned char *cp;
-           char *prefix, *suffix;
+           char *cp, *prefix, *suffix;
 
            /* Trim trailing space, esp. newline. */
            for (cp = &buf[strlen (buf) - 1];
-                cp >= buf && isspace (*cp);
+                cp >= buf && isspace ((unsigned char) *cp);
                 --cp) {
                *cp = '\0';
            }
@@ -658,11 +654,10 @@ extract_name_value (char *name_suffix, char *value) {
  * directives.  Fills in the information of the CTinfo structure.
  */
 int
-get_ctinfo (unsigned char *cp, CT ct, int magic)
+get_ctinfo (char *cp, CT ct, int magic)
 {
     int        i;
-    unsigned char *dp;
-    char **ap, **ep;
+    char *dp, **ap, **ep;
     char c;
     CI ci;
 
@@ -672,7 +667,7 @@ get_ctinfo (unsigned char *cp, CT ct, int magic)
     /* store copy of Content-Type line */
     cp = ct->c_ctline = add (cp, NULL);
 
-    while (isspace (*cp))      /* trim leading spaces */
+    while (isspace ((unsigned char) *cp))      /* trim leading spaces */
        cp++;
 
     /* change newlines to spaces */
@@ -681,7 +676,7 @@ get_ctinfo (unsigned char *cp, CT ct, int magic)
 
     /* trim trailing spaces */
     for (dp = cp + strlen (cp) - 1; dp >= cp; dp--)
-       if (!isspace (*dp))
+       if (!isspace ((unsigned char) *dp))
            break;
     *++dp = '\0';
 
@@ -705,10 +700,10 @@ get_ctinfo (unsigned char *cp, CT ct, int magic)
 
     /* down case the content type string */
     for (dp = ci->ci_type; *dp; dp++)
-       if (isalpha(*dp) && isupper (*dp))
-           *dp = tolower (*dp);
+       if (isalpha((unsigned char) *dp) && isupper ((unsigned char) *dp))
+           *dp = tolower ((unsigned char) *dp);
 
-    while (isspace (*cp))
+    while (isspace ((unsigned char) *cp))
        cp++;
 
     if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
@@ -721,7 +716,7 @@ get_ctinfo (unsigned char *cp, CT ct, int magic)
     }
 
     cp++;
-    while (isspace (*cp))
+    while (isspace ((unsigned char) *cp))
        cp++;
 
     if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
@@ -742,11 +737,11 @@ get_ctinfo (unsigned char *cp, CT ct, int magic)
 
     /* down case the content subtype string */
     for (dp = ci->ci_subtype; *dp; dp++)
-       if (isalpha(*dp) && isupper (*dp))
-           *dp = tolower (*dp);
+       if (isalpha((unsigned char) *dp) && isupper ((unsigned char) *dp))
+           *dp = tolower ((unsigned char) *dp);
 
 magic_skip:
-    while (isspace (*cp))
+    while (isspace ((unsigned char) *cp))
        cp++;
 
     if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
@@ -757,8 +752,7 @@ magic_skip:
      */
     ep = (ap = ci->ci_attrs) + NPARMS;
     while (*cp == ';') {
-       char *vp;
-       unsigned char *up;
+       char *vp, *up;
 
        if (ap >= ep) {
            advise (NULL,
@@ -768,7 +762,7 @@ magic_skip:
        }
 
        cp++;
-       while (isspace (*cp))
+       while (isspace ((unsigned char) *cp))
            cp++;
 
        if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
@@ -782,11 +776,11 @@ magic_skip:
        }
 
        /* down case the attribute name */
-       for (dp = cp; istoken (*dp); dp++)
-           if (isalpha(*dp) && isupper (*dp))
-               *dp = tolower (*dp);
+       for (dp = cp; istoken ((unsigned char) *dp); dp++)
+           if (isalpha((unsigned char) *dp) && isupper ((unsigned char) *dp))
+               *dp = tolower ((unsigned char) *dp);
 
-       for (up = dp; isspace (*dp);)
+       for (up = dp; isspace ((unsigned char) *dp);)
            dp++;
        if (dp == cp || *dp != '=') {
            advise (NULL,
@@ -797,7 +791,7 @@ magic_skip:
 
        vp = (*ap = add (cp, NULL)) + (up - cp);
        *vp = '\0';
-       for (dp++; isspace (*dp);)
+       for (dp++; isspace ((unsigned char) *dp);)
            dp++;
 
        /* now add the attribute value */
@@ -842,7 +836,7 @@ bad_quote:
        }
        ap++;
 
-       while (isspace (*cp))
+       while (isspace ((unsigned char) *cp))
            cp++;
 
        if (*cp == '(' && get_comment (ct, &cp, 1) == NOTOK)
@@ -870,7 +864,7 @@ bad_quote:
        *dp++ = c;
        cp = dp;
 
-       while (isspace (*cp))
+       while (isspace ((unsigned char) *cp))
            cp++;
     }
 
@@ -897,7 +891,7 @@ bad_quote:
        *dp++ = c;
        cp = dp;
 
-       while (isspace (*cp))
+       while (isspace ((unsigned char) *cp))
            cp++;
     }
 
@@ -924,7 +918,7 @@ bad_quote:
        *dp++ = c;
        cp = dp;
 
-       while (isspace (*cp))
+       while (isspace ((unsigned char) *cp))
            cp++;
     }
 
@@ -959,11 +953,10 @@ bad_quote:
 
 
 static int
-get_comment (CT ct, unsigned char **ap, int istype)
+get_comment (CT ct, char **ap, int istype)
 {
     int i;
-    char *bp;
-    unsigned char *cp;
+    char *bp, *cp;
     char c, buffer[BUFSIZ], *dp;
     CI ci;
 
@@ -1013,7 +1006,7 @@ invalid:
        }
     }
 
-    while (isspace (*cp))
+    while (isspace ((unsigned char) *cp))
        cp++;
 
     *ap = cp;
@@ -1105,8 +1098,7 @@ InitMultiPart (CT ct)
 {
     int        inout;
     long last, pos;
-    unsigned char *cp, *dp;
-    char **ap, **ep;
+    char *cp, *dp, **ap, **ep;
     char *bp, buffer[BUFSIZ];
     struct multipart *m;
     struct k2v *kv;
@@ -1126,8 +1118,8 @@ InitMultiPart (CT ct)
        char *cte = add (ct->c_celine ? ct->c_celine : "(null)", NULL);
 
        bp = cte + strlen (cte) - 1;
-       while (bp >= cte && isspace (*bp)) *bp-- = '\0';
-       for (bp = cte; *bp && isblank (*bp); ++bp) continue;
+       while (bp >= cte && isspace ((unsigned char) *bp)) *bp-- = '\0';
+       for (bp = cte; *bp && isblank ((unsigned char) *bp); ++bp) continue;
 
        admonish (NULL,
                  "\"%s/%s\" type in message %s must be encoded in\n"
@@ -1172,7 +1164,7 @@ InitMultiPart (CT ct)
     ct->c_ctparams = (void *) m;
 
     /* check if boundary parameter contains only whitespace characters */
-    for (cp = bp; isspace (*cp); cp++)
+    for (cp = bp; isspace ((unsigned char) *cp); cp++)
        continue;
     if (!*cp) {
        advise (NULL, "invalid \"boundary\" parameter for \"%s/%s\" type in message %s's %s: field",
@@ -1182,7 +1174,7 @@ InitMultiPart (CT ct)
 
     /* remove trailing whitespace from boundary parameter */
     for (cp = bp, dp = cp + strlen (cp) - 1; dp > cp; dp--)
-       if (!isspace (*dp))
+       if (!isspace ((unsigned char) *dp))
            break;
     *++dp = '\0';
 
@@ -1731,8 +1723,7 @@ openBase64 (CT ct, char **file)
     int fd, len, skip, own_ct_fp = 0;
     uint32_t bits;
     unsigned char value, b;
-    unsigned char *cp, *ep;
-    char buffer[BUFSIZ];
+    char *cp, *ep, buffer[BUFSIZ];
     /* sbeck -- handle suffixes */
     CI ci;
     CE ce;
@@ -1828,13 +1819,13 @@ openBase64 (CT ct, char **file)
            for (ep = (cp = buffer) + cc; cp < ep; cp++) {
                switch (*cp) {
                default:
-                   if (isspace (*cp))
+                   if (isspace ((unsigned char) *cp))
                        break;
-                   if (skip || (*cp & 0x80)
-                       || (value = b642nib[*cp & 0x7f]) > 0x3f) {
+                   if (skip || (((unsigned char) *cp) & 0x80)
+                       || (value = b642nib[((unsigned char) *cp) & 0x7f]) > 0x3f) {
                        if (debugsw) {
                            fprintf (stderr, "*cp=0x%x pos=%ld skip=%d\n",
-                               *cp,
+                               (unsigned char) *cp,
                                (long) (lseek (fd, (off_t) 0, SEEK_CUR) - (ep - cp)),
                                skip);
                        }
@@ -1965,7 +1956,7 @@ static int
 openQuoted (CT ct, char **file)
 {
     int        cc, digested, len, quoted, own_ct_fp = 0;
-    unsigned char *cp, *ep;
+    char *cp, *ep;
     char buffer[BUFSIZ];
     unsigned char mask;
     CE ce;
@@ -2057,7 +2048,7 @@ openQuoted (CT ct, char **file)
        len -= cc;
 
        for (ep = (cp = buffer) + cc - 1; cp <= ep; ep--)
-           if (!isspace (*ep))
+           if (!isspace ((unsigned char) *ep))
                break;
        *++ep = '\n', ep++;
 
@@ -2066,13 +2057,13 @@ openQuoted (CT ct, char **file)
                /* in an escape sequence */
                if (quoted == 1) {
                    /* at byte 1 of an escape sequence */
-                   mask = hex2nib[*cp & 0x7f];
+                   mask = hex2nib[((unsigned char) *cp) & 0x7f];
                    /* next is byte 2 */
                    quoted = 2;
                } else {
                    /* at byte 2 of an escape sequence */
                    mask <<= 4;
-                   mask |= hex2nib[*cp & 0x7f];
+                   mask |= hex2nib[((unsigned char) *cp) & 0x7f];
                    putc (mask, ce->ce_fp);
                    if (digested)
                        MD5Update (&mdContext, &mask, 1);
@@ -2099,7 +2090,8 @@ openQuoted (CT ct, char **file)
                if (cp + 1 >= ep || cp + 2 >= ep) {
                    /* We don't have 2 bytes left, so this is an invalid
                     * escape sequence; just show the raw bytes (below). */
-               } else if (isxdigit (cp[1]) && isxdigit (cp[2])) {
+               } else if (isxdigit ((unsigned char) cp[1]) &&
+                                       isxdigit ((unsigned char) cp[2])) {
                    /* Next 2 bytes are hex digits, making this a valid escape
                     * sequence; let's decode it (above). */
                    quoted = 1;
index e5f82bf..4ab7328 100644 (file)
--- a/uip/msh.c
+++ b/uip/msh.c
@@ -1274,8 +1274,7 @@ static int
 parse (char *buffer, struct Cmd *cmdp)
 {
     int argp = 0;
-    unsigned char c, *cp;
-    char *pp;
+    char c, *cp, *pp;
 
     cmdp->line[0] = 0;
     pp = cmdp->args[argp++] = cmdp->line;
@@ -1284,7 +1283,7 @@ parse (char *buffer, struct Cmd *cmdp)
     cmdp->stream = NULL;
 
     for (cp = buffer; (c = *cp); cp++) {
-       if (!isspace (c))
+       if (!isspace ((unsigned char) c))
            break;
     }
     if (c == '\0') {
@@ -1294,8 +1293,8 @@ parse (char *buffer, struct Cmd *cmdp)
     }
 
     while ((c = *cp++)) {
-       if (isspace (c)) {
-           while (isspace (c))
+       if (isspace ((unsigned char) c)) {
+           while (isspace ((unsigned char) c))
                c = *cp++;
            if (c == 0)
                break;
@@ -1350,7 +1349,7 @@ parse (char *buffer, struct Cmd *cmdp)
                }
                cmdp->redirect = pp + 1;/* sigh */
                for (; (c = *cp); cp++)
-                   if (!isspace (c))
+                   if (!isspace ((unsigned char) c))
                        break;
                if (c == 0) {
                    padvise (NULL, cmdp->direction != PIPIO
@@ -1361,7 +1360,7 @@ parse (char *buffer, struct Cmd *cmdp)
                strcpy (cmdp->redirect, cp);
                if (cmdp->direction != PIPIO) {
                    for (; *cp; cp++)
-                       if (isspace (*cp)) {
+                       if (isspace ((unsigned char) *cp)) {
                            padvise (NULL, "bad name for redirect");
                            return NOTOK;
                        }
@@ -1593,7 +1592,7 @@ static int
 pINI (void)
 {
     int i, vrsn;
-    unsigned char *bp;
+    char *bp;
     struct record rcs, *rc;
 
     rc = &rcs;
@@ -1602,7 +1601,7 @@ pINI (void)
     switch (peer2rc (rc)) {
        case RC_INI: 
            bp = rc->rc_data;
-           while (isspace (*bp))
+           while (isspace ((unsigned char) *bp))
                bp++;
            if (sscanf (bp, "%d", &vrsn) != 1) {
        bad_init: ;
@@ -1614,9 +1613,9 @@ pINI (void)
                done (1);
            }
 
-           while (*bp && !isspace (*bp))
+           while (*bp && !isspace ((unsigned char) *bp))
                bp++;
-           while (isspace (*bp))
+           while (isspace ((unsigned char) *bp))
                bp++;
            if (sscanf (bp, "%d", &numwins) != 1 || numwins <= 0)
                goto bad_init;
@@ -1624,9 +1623,9 @@ pINI (void)
                numwins = NWIN;
 
            for (i = 1; i <= numwins; i++) {
-               while (*bp && !isspace (*bp))
+               while (*bp && !isspace ((unsigned char) *bp))
                    bp++;
-               while (isspace (*bp))
+               while (isspace ((unsigned char) *bp))
                    bp++;
                if (sscanf (bp, "%d", &windows[i]) != 1 || windows[i] <= 0)
                    goto bad_init;
index 6ea1126..4101743 100644 (file)
@@ -2332,8 +2332,7 @@ static int
 is_nontext (int msgnum)
 {
     int        result, state;
-    unsigned char *bp, *dp;
-    char *cp;
+    char *bp, *dp, *cp;
     char buf[BUFSIZ], name[NAMESZ];
     FILE *fp;
 
@@ -2365,7 +2364,7 @@ is_nontext (int msgnum)
                passno = 1;
 
 again:
-               for (; isspace (*bp); bp++)
+               for (; isspace ((unsigned char) *bp); bp++)
                    continue;
                if (*bp == '(') {
                    int i;
@@ -2410,24 +2409,24 @@ invalid:
                    if ((result = (mh_strcasecmp (bp, "plain") != 0)))
                        goto out;
                    *dp = c;
-                   for (dp++; isspace (*dp); dp++)
+                   for (dp++; isspace ((unsigned char) *dp); dp++)
                        continue;
                    if (*dp) {
                        if ((result = !uprf (dp, "charset")))
                            goto out;
                        dp += sizeof "charset" - 1;
-                       while (isspace (*dp))
+                       while (isspace ((unsigned char) *dp))
                            dp++;
                        if (*dp++ != '=')
                            goto invalid;
-                       while (isspace (*dp))
+                       while (isspace ((unsigned char) *dp))
                            dp++;
                        if (*dp == '"') {
                            if ((bp = strchr(++dp, '"')))
                                *bp = '\0';
                        } else {
                            for (bp = dp; *bp; bp++)
-                               if (isspace (*bp)) {
+                               if (isspace ((unsigned char) *bp)) {
                                    *bp = '\0';
                                    break;
                                }
@@ -2465,7 +2464,7 @@ out:
                    state = m_getfld (&gstate, name, buf, &bufsz, fp);
                    cp = add (buf, cp);
                }
-               for (bp = cp; isspace (*bp); bp++)
+               for (bp = cp; isspace ((unsigned char) *bp); bp++)
                    continue;
                for (dp = bp; istoken (*dp); dp++)
                    continue;
index c572cde..ec7400a 100644 (file)
@@ -562,8 +562,8 @@ gcompile (struct nexus *n, char *astr)
     int cclcnt;
     register unsigned char *ep, *dp, *sp, *lastep = 0;
 
-    dp = (ep = n->n_expbuf) + sizeof n->n_expbuf;
-    sp = astr;
+    dp = (ep = (unsigned char *) n->n_expbuf) + sizeof n->n_expbuf;
+    sp = (unsigned char *) astr;
     if (*sp == '^') {
        n->n_circf = 1;
        sp++;
@@ -802,7 +802,7 @@ advance (char *alp, char *aep)
        star: 
                do {
                    lp--;
-                   if (advance (lp, ep))
+                   if (advance ((char *) lp, (char *) ep))
                        return (1);
                } while (lp > curlp);
                return 0;
index 35cf91f..716f70e 100644 (file)
@@ -261,7 +261,7 @@ static int insert (struct mailname *);
 static void pl (void);
 static void anno (void);
 static int annoaux (struct mailname *);
-static void insert_fcc (struct headers *, unsigned char *);
+static void insert_fcc (struct headers *, char *);
 static void make_bcc_file (int);
 static void verify_all_addresses (int, char *);
 static void chkadr (void);
@@ -921,8 +921,7 @@ putfmt (char *name, char *str, FILE *out)
 static void
 start_headers (void)
 {
-    unsigned char  *cp;
-    char sigbuf[BUFSIZ];
+    char  *cp, sigbuf[BUFSIZ];
     struct mailname *mp;
 
     time (&tclock);
@@ -1253,13 +1252,13 @@ annoaux (struct mailname *mp)
 
 
 static void
-insert_fcc (struct headers *hdr, unsigned char *pp)
+insert_fcc (struct headers *hdr, char *pp)
 {
-    unsigned char *cp;
+    char *cp;
 
-    for (cp = pp; isspace (*cp); cp++)
+    for (cp = pp; isspace ((unsigned char) *cp); cp++)
        continue;
-    for (pp += strlen (pp) - 1; pp > cp && isspace (*pp); pp--)
+    for (pp += strlen (pp) - 1; pp > cp && isspace ((unsigned char) *pp); pp--)
        continue;
     if (pp >= cp)
        *++pp = 0;
@@ -1399,7 +1398,7 @@ static int
 find_prefix (void)
 {
     int        result = OK;
-    unsigned char buffer[BUFSIZ];
+    char buffer[BUFSIZ];
     FILE *in;
 
     if ((in = fopen (tmpfil, "r")) == NULL)
@@ -1407,10 +1406,10 @@ find_prefix (void)
 
     while (fgets (buffer, sizeof(buffer) - 1, in))
        if (buffer[0] == '-' && buffer[1] == '-') {
-           unsigned char *cp;
+           char *cp;
 
            for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--)
-               if (!isspace (*cp))
+               if (!isspace ((unsigned char) *cp))
                    break;
            *++cp = '\0';
            if (strcmp (buffer + 2, prefix) == 0) {
index 25049af..eff1877 100644 (file)
@@ -69,8 +69,7 @@ replout (FILE *inb, char *msg, char *drft, struct msgs *mp, int outputlinelen,
     struct format *fmt;
     register char **ap;
     int        char_read = 0, format_len, mask;
-    char name[NAMESZ], *scanl;
-    unsigned char *cp;
+    char name[NAMESZ], *scanl, *cp;
     static int dat[5];                 /* aux. data for format routine */
     m_getfld_state_t gstate = 0;
 
@@ -187,7 +186,7 @@ finished:
        register char *sp = cp;
 
        for (;;) {
-           while (isspace(*cp))
+           while (isspace((unsigned char) *cp))
                cp++;
            if(uprf(cp, "re:"))
                cp += 3;
index 930cfbc..0f6cd7e 100644 (file)
@@ -61,8 +61,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg,
       int unseen, char *folder, long size, int noisy)
 {
     int i, compnum, encrypted, state;
-    unsigned char *cp, *tmpbuf, *startbody;
-    char **nxtbuf;
+    char *cp, *tmpbuf, *startbody, **nxtbuf;
     char *saved_c_text = NULL;
     struct comp *cptr;
     struct comp **savecomp;
@@ -210,7 +209,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg,
                        cptr->c_text = tmpbuf;
                        for (cp = tmpbuf + strlen (tmpbuf) - 1; 
                                        cp >= tmpbuf; cp--)
-                           if (isspace (*cp))
+                           if (isspace ((unsigned char) *cp))
                                *cp = 0;
                            else
                                break;
index f997813..f513ebd 100644 (file)
@@ -332,8 +332,7 @@ static int
 is_nontext (char *msgnam)
 {
     int        result, state;
-    unsigned char *bp, *dp;
-    char *cp;
+    char *bp, *dp, *cp;
     char buf[BUFSIZ], name[NAMESZ];
     FILE *fp;
     m_getfld_state_t gstate = 0;
@@ -363,7 +362,7 @@ is_nontext (char *msgnam)
                passno = 1;
 
 again:
-               for (; isspace (*bp); bp++)
+               for (; isspace ((unsigned char) *bp); bp++)
                    continue;
                if (*bp == '(') {
                    int i;
@@ -408,17 +407,17 @@ invalid:
                    if ((result = (mh_strcasecmp (bp, "plain") != 0)))
                        goto out;
                    *dp = c;
-                   for (dp++; isspace (*dp); dp++)
+                   for (dp++; isspace ((unsigned char) *dp); dp++)
                        continue;
                    if (*dp) {
                        if ((result = !uprf (dp, "charset")))
                            goto out;
                        dp += sizeof("charset") - 1;
-                       while (isspace (*dp))
+                       while (isspace ((unsigned char) *dp))
                            dp++;
                        if (*dp++ != '=')
                            goto invalid;
-                       while (isspace (*dp))
+                       while (isspace ((unsigned char) *dp))
                            dp++;
                        if (*dp == '"') {
                            if ((bp = strchr(++dp, '"')))
@@ -464,9 +463,9 @@ out:
                    state = m_getfld (&gstate, name, buf, &bufsz, fp);
                    cp = add (buf, cp);
                }
-               for (bp = cp; isspace (*bp); bp++)
+               for (bp = cp; isspace ((unsigned char) *bp); bp++)
                    continue;
-               for (dp = bp; istoken (*dp); dp++)
+               for (dp = bp; istoken ((unsigned char) *dp); dp++)
                    continue;
                *dp = '\0';
                result = (mh_strcasecmp (bp, "7bit")
index 3c5e512..f570aaa 100644 (file)
@@ -645,7 +645,7 @@ static int
 split (char *cp, char **vec)
 {
     int i;
-    unsigned char *s;
+    char *s;
 
     s = cp;
 
@@ -654,7 +654,7 @@ split (char *cp, char **vec)
        vec[i] = NULL;
 
        /* zap any whitespace and comma's */
-       while (isspace (*s) || *s == ',')
+       while (isspace ((unsigned char) *s) || *s == ',')
            *s++ = 0;
 
        /* end of buffer, time to leave */
@@ -684,7 +684,7 @@ split (char *cp, char **vec)
        vec[i++] = s++;
 
        /* move forward to next field delimiter */
-       while (*s && !isspace (*s) && *s != ',')
+       while (*s && !isspace ((unsigned char) *s) && *s != ',')
            s++;
     }
     vec[i] = NULL;
@@ -1153,8 +1153,8 @@ static void
 get_sender (char *envelope, char **sender)
 {
     int i;
-    unsigned char *cp;
-    unsigned char buffer[BUFSIZ];
+    char *cp;
+    char buffer[BUFSIZ];
 
     if (envelope == NULL) {
        *sender = getcpy ("");
@@ -1174,7 +1174,7 @@ get_sender (char *envelope, char **sender)
     *cp = 0;
 
     for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--)
-       if (isspace (*cp))
+       if (isspace ((unsigned char) *cp))
            *cp = 0;
        else
            break;
@@ -1296,7 +1296,7 @@ static char *
 trim (char *cp)
 {
     char buffer[BUFSIZ*4];
-    unsigned char *bp, *sp;
+    char *bp, *sp;
 
     if (cp == NULL)
        return NULL;
@@ -1306,12 +1306,12 @@ trim (char *cp)
     bp = buffer;
 
     /* skip over leading whitespace */
-    while (isspace(*bp))
+    while (isspace((unsigned char) *bp))
        bp++;
 
     /* start at the end and zap trailing whitespace */
     for (sp = bp + strlen(bp) - 1; sp >= bp; sp--) {
-       if (isspace(*sp))
+       if (isspace((unsigned char) *sp))
            *sp = 0;
        else
            break;
@@ -1319,7 +1319,7 @@ trim (char *cp)
 
     /* replace remaining whitespace with spaces */
     for (sp = bp; *sp; sp++)
-       if (isspace(*sp))
+       if (isspace((unsigned char) *sp))
            *sp = ' ';
 
     /* now return a copy */
index b8dc968..6e7a749 100644 (file)
@@ -364,8 +364,7 @@ get_fields (char *datesw, int msg, struct smsg *smsg)
     }
     for (compnum = 1;;) {
        int bufsz = sizeof buf;
-       switch (state = m_getfld (&gstate, (unsigned char *) nam,
-                                 (unsigned char *) buf, &bufsz, in)) {
+       switch (state = m_getfld (&gstate, nam, buf, &bufsz, in)) {
        case FLD:
        case FLDPLUS:
            compnum++;
@@ -373,8 +372,7 @@ get_fields (char *datesw, int msg, struct smsg *smsg)
                datecomp = add (buf, datecomp);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
-                   state = m_getfld (&gstate, (unsigned char *) nam,
-                                     (unsigned char *) buf, &bufsz, in);
+                   state = m_getfld (&gstate, nam, buf, &bufsz, in);
                    datecomp = add (buf, datecomp);
                }
                if (!subjsort || subjcomp)
@@ -383,8 +381,7 @@ get_fields (char *datesw, int msg, struct smsg *smsg)
                subjcomp = add (buf, subjcomp);
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
-                   state = m_getfld (&gstate, (unsigned char *) nam,
-                                     (unsigned char *) buf, &bufsz, in);
+                   state = m_getfld (&gstate, nam, buf, &bufsz, in);
                    subjcomp = add (buf, subjcomp);
                }
                if (datecomp)
@@ -393,8 +390,7 @@ get_fields (char *datesw, int msg, struct smsg *smsg)
                /* just flush this guy */
                while (state == FLDPLUS) {
                    bufsz = sizeof buf;
-                   state = m_getfld (&gstate, (unsigned char *) nam,
-                                     (unsigned char *) buf, &bufsz, in);
+                   state = m_getfld (&gstate, nam, buf, &bufsz, in);
                }
            }
            continue;