Index: alias.c
===================================================================
RCS file: /home/roessler/cvs/mutt/alias.c,v
retrieving revision 3.7
diff -d -u -r3.7 alias.c
--- alias.c	4 Mar 2003 07:45:45 -0000	3.7
+++ alias.c	24 Jul 2003 11:50:56 -0000
@@ -353,7 +353,7 @@
 static int check_alias_name_char (char c)
 {
   return (c == '-' || c == '_' || c == '+' || c == '=' || c == '.' ||
-	  isalnum (c));
+	  isalnum ((unsigned char) c));
 }
 
 int mutt_check_alias_name (const char *s, char *d)
Index: copy.c
===================================================================
RCS file: /home/roessler/cvs/mutt/copy.c,v
retrieving revision 3.9
diff -d -u -r3.9 copy.c
--- copy.c	12 Mar 2003 13:00:03 -0000	3.9
+++ copy.c	24 Jul 2003 11:50:57 -0000
@@ -844,7 +844,7 @@
 
   ADDRESS *a = NULL;
 
-  switch (tolower (*s))
+  switch (tolower ((unsigned char) *s))
   {
     case 'r': 
     {
Index: handler.c
===================================================================
RCS file: /home/roessler/cvs/mutt/handler.c,v
retrieving revision 3.13
diff -d -u -r3.13 handler.c
--- handler.c	4 Mar 2003 09:31:19 -0000	3.13
+++ handler.c	24 Jul 2003 11:50:57 -0000
@@ -154,7 +154,9 @@
     return 1;
   
   /* quoted-printable triple */
-  if (*s == '=' && isxdigit (*(s+1)) && isxdigit (*(s+2)))
+  if (*s == '=' &&
+      isxdigit ((unsigned char) *(s+1)) &&
+      isxdigit ((unsigned char) *(s+2)))
   {
     *d = (hexval (*(s+1)) << 4) | hexval (*(s+2));
     return 0;
Index: init.c
===================================================================
RCS file: /home/roessler/cvs/mutt/init.c,v
retrieving revision 3.13
diff -d -u -r3.13 init.c
--- init.c	29 May 2003 17:47:10 -0000	3.13
+++ init.c	24 Jul 2003 11:50:57 -0000
@@ -139,7 +139,8 @@
 	case 'C':
 	    if (!*tok->dptr)
 		return -1; /* premature end of token */
-	  mutt_buffer_addch (dest, (toupper (*tok->dptr) - '@') & 0x7f);
+	  mutt_buffer_addch (dest, (toupper ((unsigned char) *tok->dptr)
+                                    - '@') & 0x7f);
 	  tok->dptr++;
 	  break;
 	case 'r':
@@ -180,7 +181,7 @@
       else if (ch == '[')
 	mutt_buffer_addch (dest, '\033');
       else if (isalpha ((unsigned char) ch))
-	mutt_buffer_addch (dest, toupper (ch) - '@');
+	mutt_buffer_addch (dest, toupper ((unsigned char) ch) - '@');
       else
       {
 	mutt_buffer_addch (dest, '^');
Index: keymap.c
===================================================================
RCS file: /home/roessler/cvs/mutt/keymap.c,v
retrieving revision 3.9
diff -d -u -r3.9 keymap.c
--- keymap.c	16 Jul 2003 11:17:31 -0000	3.9
+++ keymap.c	24 Jul 2003 11:50:57 -0000
@@ -120,7 +120,10 @@
  */
 static int parse_keycode (const char *s)
 {
-  if (isdigit (s[1]) && isdigit (s[2]) && isdigit (s[3]) && s[4] == '>')
+  if (isdigit ((unsigned char) s[1]) &&
+      isdigit ((unsigned char) s[2]) &&
+      isdigit ((unsigned char) s[3]) &&
+      s[4] == '>')
   {
     return (s[3] - '0') + (s[2] - '0') * 8 + (s[1] - '0') * 64;
   }
Index: lib.c
===================================================================
RCS file: /home/roessler/cvs/mutt/lib.c,v
retrieving revision 3.8
diff -d -u -r3.8 lib.c
--- lib.c	8 Apr 2003 22:32:56 -0000	3.8
+++ lib.c	24 Jul 2003 11:50:57 -0000
@@ -170,7 +170,7 @@
 
   while (*p)
   {
-    *p = tolower (*p);
+    *p = tolower ((unsigned char) *p);
     p++;
   }
 
@@ -608,7 +608,10 @@
 
   while (*(p = haystack))
   {
-    for (q = needle; *p && *q && tolower (*p) == tolower (*q); p++, q++)
+    for (q = needle;
+         *p && *q &&
+           tolower ((unsigned char) *p) == tolower ((unsigned char) *q);
+         p++, q++)
       ;
     if (!*q)
       return (haystack);
Index: makedoc.c
===================================================================
RCS file: /home/roessler/cvs/mutt/makedoc.c,v
retrieving revision 3.1
diff -d -u -r3.1 makedoc.c
--- makedoc.c	11 Dec 2002 11:19:40 -0000	3.1
+++ makedoc.c	24 Jul 2003 11:50:57 -0000
@@ -218,7 +218,7 @@
 
 static char *skip_ws (char *s)
 {
-  while (*s && isspace (*s))
+  while (*s && isspace ((unsigned char) *s))
     s++;
 
   return s;
@@ -300,7 +300,7 @@
     }
     else if (!is_quoted && strchr (single_char_tokens, *t))
       break;
-    else if (!is_quoted && isspace (*t))
+    else if (!is_quoted && isspace ((unsigned char) *t))
       break;
     else
       *d++ = *t;
@@ -486,14 +486,14 @@
     {
       /* heuristic! */
       strncpy (t, s + 5, l);
-      for (; *t; t++) *t = tolower (*t);
+      for (; *t; t++) *t = tolower ((unsigned char) *t);
       break;
     }
     case DT_MAGIC:
     {
       /* heuristic! */
       strncpy (t, s + 2, l);
-      for (; *t; t++) *t = tolower (*t);
+      for (; *t; t++) *t = tolower ((unsigned char) *t);
       break;
     }
     case DT_STR:
@@ -1188,7 +1188,7 @@
       else
       {
 	ref = s;
-	while (isalnum (*s) || *s == '-' || *s == '_')
+	while (isalnum ((unsigned char) *s) || *s == '-' || *s == '_')
 	  ++s;
 
 	docstat = commit_buff (buff, &d, out, docstat);
Index: muttlib.c
===================================================================
RCS file: /home/roessler/cvs/mutt/muttlib.c,v
retrieving revision 3.15
diff -d -u -r3.15 muttlib.c
--- muttlib.c	4 Jul 2003 16:57:56 -0000	3.15
+++ muttlib.c	24 Jul 2003 11:50:57 -0000
@@ -521,7 +521,7 @@
       memmove (&dest[idx + pwnl], &dest[idx + 1],
 	       MAX(destlen - idx - pwnl - 1, 0));
       memcpy (&dest[idx], pw->pw_name, MIN(destlen - idx - 1, pwnl));
-      dest[idx] = toupper (dest[idx]);
+      dest[idx] = toupper ((unsigned char) dest[idx]);
     }
   }
       
Index: pattern.c
===================================================================
RCS file: /home/roessler/cvs/mutt/pattern.c,v
retrieving revision 3.9
diff -d -u -r3.9 pattern.c
--- pattern.c	4 Jul 2003 17:03:51 -0000	3.9
+++ pattern.c	24 Jul 2003 11:50:57 -0000
@@ -278,12 +278,12 @@
     }
     else
       pat->min = strtol (s->dptr, &tmp, 0);
-    if (toupper (*tmp) == 'K') /* is there a prefix? */
+    if (toupper ((unsigned char) *tmp) == 'K') /* is there a prefix? */
     {
       pat->min *= 1024;
       tmp++;
     }
-    else if (toupper (*tmp) == 'M')
+    else if (toupper ((unsigned char) *tmp) == 'M')
     {
       pat->min *= 1048576;
       tmp++;
@@ -312,12 +312,12 @@
   {
     /* range maximum */
     pat->max = strtol (tmp, &tmp, 0);
-    if (toupper (*tmp) == 'K')
+    if (toupper ((unsigned char) *tmp) == 'K')
     {
       pat->max *= 1024;
       tmp++;
     }
-    else if (toupper (*tmp) == 'M')
+    else if (toupper ((unsigned char) *tmp) == 'M')
     {
       pat->max *= 1048576;
       tmp++;
Index: rfc2047.c
===================================================================
RCS file: /home/roessler/cvs/mutt/rfc2047.c,v
retrieving revision 3.5
diff -d -u -r3.5 rfc2047.c
--- rfc2047.c	16 Dec 2002 20:28:46 -0000	3.5
+++ rfc2047.c	24 Jul 2003 11:50:57 -0000
@@ -606,9 +606,9 @@
 	charset[t-pp] = '\0';
 	break;
       case 3:
-	if (toupper (*pp) == 'Q')
+	if (toupper ((unsigned char) *pp) == 'Q')
 	  enc = ENCQUOTEDPRINTABLE;
-	else if (toupper (*pp) == 'B')
+	else if (toupper ((unsigned char) *pp) == 'B')
 	  enc = ENCBASE64;
 	else
 	{
Index: rfc2231.c
===================================================================
RCS file: /home/roessler/cvs/mutt/rfc2231.c,v
retrieving revision 3.2
diff -d -u -r3.2 rfc2231.c
--- rfc2231.c	11 Dec 2002 11:19:40 -0000	3.2
+++ rfc2231.c	24 Jul 2003 11:50:57 -0000
@@ -135,7 +135,7 @@
     else
     {
       *s = '\0'; s++; /* let s point to the first character of index. */
-      for (t = s; *t && isdigit (*t); t++)
+      for (t = s; *t && isdigit ((unsigned char) *t); t++)
 	;
       encoded = (*t == '*');
       *t = '\0';
@@ -208,7 +208,9 @@
 
   for (d = dest; *src; src++)
   {
-    if (*src == '%' && isxdigit (*(src + 1)) && isxdigit (*(src + 2)))
+    if (*src == '%' &&
+        isxdigit ((unsigned char) *(src + 1)) &&
+        isxdigit ((unsigned char) *(src + 2)))
     {
       *d++ = (hexval (*(src + 1)) << 4) | (hexval (*(src + 2)));
       src += 2;
Index: rfc822.c
===================================================================
RCS file: /home/roessler/cvs/mutt/rfc822.c,v
retrieving revision 3.5
diff -d -u -r3.5 rfc822.c
--- rfc822.c	3 Mar 2003 14:01:06 -0000	3.5
+++ rfc822.c	24 Jul 2003 11:50:57 -0000
@@ -174,7 +174,7 @@
   }
   while (*s)
   {
-    if (ISSPACE (*s) || is_special (*s))
+    if (ISSPACE ((unsigned char) *s) || is_special (*s))
       break;
     if (*tokenlen < tokenmax)
       token[(*tokenlen)++] = *s;
@@ -345,7 +345,7 @@
   while (last && last->next)
     last = last->next;
 
-  ws_pending = isspace (*s);
+  ws_pending = isspace ((unsigned char) *s);
   
   SKIPWS (s);
   begin = s;
@@ -479,7 +479,7 @@
       }
       s = ps;
     }
-    ws_pending = isspace (*s);
+    ws_pending = isspace ((unsigned char) *s);
     SKIPWS (s);
   }
   
Index: strcasecmp.c
===================================================================
RCS file: /home/roessler/cvs/mutt/strcasecmp.c,v
retrieving revision 3.0
diff -d -u -r3.0 strcasecmp.c
--- strcasecmp.c	24 Jan 2002 12:10:52 -0000	3.0
+++ strcasecmp.c	24 Jul 2003 11:50:57 -0000
@@ -9,8 +9,8 @@
   
   while (*s1 && *s2 && l < n)
   {
-    c1 = tolower (*s1);
-    c2 = tolower (*s2);
+    c1 = tolower ((unsigned char) *s1);
+    c2 = tolower ((unsigned char) *s2);
     if (c1 != c2)
       return (c1 - c2);
     s1++;
@@ -29,8 +29,8 @@
   
   while (*s1 && *s2)
   {
-    c1 = tolower (*s1);
-    c2 = tolower (*s2);
+    c1 = tolower ((unsigned char) *s1);
+    c2 = tolower ((unsigned char) *s2);
     if (c1 != c2)
       return (c1 - c2);
     s1++;
Index: url.c
===================================================================
RCS file: /home/roessler/cvs/mutt/url.c,v
retrieving revision 3.3
diff -d -u -r3.3 url.c
--- url.c	16 Dec 2002 20:28:46 -0000	3.3
+++ url.c	24 Jul 2003 11:50:57 -0000
@@ -50,7 +50,8 @@
   for (d = s; *s; s++)
   {
     if (*s == '%' && s[1] && s[2] &&
-	isxdigit (s[1]) && isxdigit (s[2]) &&
+	isxdigit ((unsigned char) s[1]) &&
+        isxdigit ((unsigned char) s[2]) &&
 	hexval (s[1]) >= 0 && hexval (s[2]) >= 0)
     {
       *d++ = (hexval (s[1]) << 4) | (hexval (s[2]));
Index: imap/command.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/command.c,v
retrieving revision 3.5
diff -d -u -r3.5 command.c
--- imap/command.c	15 Jul 2003 11:41:32 -0000	3.5
+++ imap/command.c	24 Jul 2003 11:50:57 -0000
@@ -308,7 +308,7 @@
 
   s = imap_next_word (idata->cmd.buf);
 
-  if ((idata->state == IMAP_SELECTED) && isdigit (*s))
+  if ((idata->state == IMAP_SELECTED) && isdigit ((unsigned char) *s))
   {
     pn = s;
     s = imap_next_word (s);
@@ -525,7 +525,7 @@
   /* zero out current rights set */
   memset (idata->rights, 0, sizeof (idata->rights));
 
-  while (*s && !isspace(*s))
+  while (*s && !isspace((unsigned char) *s))
   {
     switch (*s) 
     {
Index: imap/imap.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/imap.c,v
retrieving revision 3.9
diff -d -u -r3.9 imap.c
--- imap/imap.c	16 Jul 2003 11:18:12 -0000	3.9
+++ imap/imap.c	24 Jul 2003 11:50:57 -0000
@@ -1234,7 +1234,7 @@
       {
 	s = imap_next_word (s);
 	s = imap_next_word (s);
-	if (isdigit (*s))
+	if (isdigit ((unsigned char) *s))
 	{
 	  if (*s != '0')
 	  {
Index: imap/message.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/message.c,v
retrieving revision 3.4
diff -d -u -r3.4 message.c
--- imap/message.c	10 Dec 2002 20:56:52 -0000	3.4
+++ imap/message.c	24 Jul 2003 11:50:57 -0000
@@ -852,7 +852,7 @@
       s += 11;
       SKIPWS (s);
       ptmp = tmp;
-      while (isdigit (*s))
+      while (isdigit ((unsigned char) *s))
         *ptmp++ = *s++;
       *ptmp = 0;
       h->content_length = atoi (tmp);
Index: imap/util.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/util.c,v
retrieving revision 3.4
diff -d -u -r3.4 util.c
--- imap/util.c	15 Jul 2003 11:41:32 -0000	3.4
+++ imap/util.c	24 Jul 2003 11:50:57 -0000
@@ -310,7 +310,7 @@
     return (-1);
   pc++;
   pn = pc;
-  while (isdigit (*pc))
+  while (isdigit ((unsigned char) *pc))
     pc++;
   *pc = 0;
   *bytes = atoi(pn);
Index: intl/l10nflist.c
===================================================================
RCS file: /home/roessler/cvs/mutt/intl/l10nflist.c,v
retrieving revision 3.0
diff -d -u -r3.0 l10nflist.c
--- intl/l10nflist.c	24 Jan 2002 13:35:16 -0000	3.0
+++ intl/l10nflist.c	24 Jul 2003 11:50:57 -0000
@@ -356,11 +356,11 @@
   size_t cnt;
 
   for (cnt = 0; cnt < name_len; ++cnt)
-    if (isalnum (codeset[cnt]))
+    if (isalnum ((unsigned char) codeset[cnt]))
       {
 	++len;
 
-	if (isalpha (codeset[cnt]))
+	if (isalpha ((unsigned char) codeset[cnt]))
 	  only_digit = 0;
       }
 
@@ -374,9 +374,9 @@
 	wp = retval;
 
       for (cnt = 0; cnt < name_len; ++cnt)
-	if (isalpha (codeset[cnt]))
-	  *wp++ = tolower (codeset[cnt]);
-	else if (isdigit (codeset[cnt]))
+	if (isalpha ((unsigned char) codeset[cnt]))
+	  *wp++ = tolower ((unsigned char) codeset[cnt]);
+	else if (isdigit ((unsigned char) codeset[cnt]))
 	  *wp++ = codeset[cnt];
 
       *wp = '\0';
Index: intl/loadmsgcat.c
===================================================================
RCS file: /home/roessler/cvs/mutt/intl/loadmsgcat.c,v
retrieving revision 3.0
diff -d -u -r3.0 loadmsgcat.c
--- intl/loadmsgcat.c	24 Jan 2002 13:35:16 -0000	3.0
+++ intl/loadmsgcat.c	24 Jul 2003 11:50:57 -0000
@@ -508,7 +508,7 @@
 	  struct parse_args args;
 
 	  nplurals += 9;
-	  while (*nplurals != '\0' && isspace (*nplurals))
+	  while (*nplurals != '\0' && isspace ((unsigned char) *nplurals))
 	    ++nplurals;
 #if defined HAVE_STRTOUL || defined _LIBC
 	  n = strtoul (nplurals, &endp, 10);
Index: intl/localealias.c
===================================================================
RCS file: /home/roessler/cvs/mutt/intl/localealias.c,v
retrieving revision 3.0
diff -d -u -r3.0 localealias.c
--- intl/localealias.c	24 Jan 2002 13:35:16 -0000	3.0
+++ intl/localealias.c	24 Jul 2003 11:50:57 -0000
@@ -244,21 +244,21 @@
 
       cp = buf;
       /* Ignore leading white space.  */
-      while (isspace (cp[0]))
+      while (isspace ((unsigned char) cp[0]))
 	++cp;
 
       /* A leading '#' signals a comment line.  */
       if (cp[0] != '\0' && cp[0] != '#')
 	{
 	  alias = cp++;
-	  while (cp[0] != '\0' && !isspace (cp[0]))
+	  while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
 	    ++cp;
 	  /* Terminate alias name.  */
 	  if (cp[0] != '\0')
 	    *cp++ = '\0';
 
 	  /* Now look for the beginning of the value.  */
-	  while (isspace (cp[0]))
+	  while (isspace ((unsigned char) cp[0]))
 	    ++cp;
 
 	  if (cp[0] != '\0')
@@ -267,7 +267,7 @@
 	      size_t value_len;
 
 	      value = cp++;
-	      while (cp[0] != '\0' && !isspace (cp[0]))
+	      while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
 		++cp;
 	      /* Terminate value.  */
 	      if (cp[0] == '\n')
