]> granicus.if.org Git - mutt/commitdiff
While I'm on it, fix a warning and remove some weired code by proper
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 13 Feb 2001 22:14:19 +0000 (22:14 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 13 Feb 2001 22:14:19 +0000 (22:14 +0000)
use of ctype functions.

charset.c

index e6529be736da1cac4114730967a879544048e0dc..34a8f02c1d2c5e4fd351ba7e2ed2d04c4f16f61e 100644 (file)
--- a/charset.c
+++ b/charset.c
@@ -24,6 +24,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <ctype.h>
+
 #include <sys/types.h>
 #include <dirent.h>
 #include <unistd.h>
@@ -238,8 +240,8 @@ void mutt_canonical_charset (char *dest, size_t dlen, const char *name)
 
   /* for cosmetics' sake, transform to lowercase. */
   for (p = dest; *p; p++)
-    if ('A' <= *p && *p <= 'Z')
-      *p += 'a' - 'A';
+    if (isupper (*p))
+      *p = tolower (*p);
 }
 
 int mutt_chscmp (const char *s, const char *chs)
@@ -520,5 +522,5 @@ void fgetconv_close (FGETCONV **_fc)
 
   if (fc->cd != (iconv_t)-1)
     iconv_close (fc->cd);
-  safe_free (_fc);
+  safe_free ((void **) _fc);
 }