summaryrefslogtreecommitdiffstats
path: root/charset.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2001-02-13 22:14:19 +0000
committerThomas Roessler <roessler@does-not-exist.org>2001-02-13 22:14:19 +0000
commit3e5d674c61027bf31016614bf5999f4f53c23c6a (patch)
treef1afb2256a59b911fea9f6c0271d8b9d25102e9c /charset.c
parentfc49175b05b13d851688e5d30551933e83274c3c (diff)
While I'm on it, fix a warning and remove some weired code by proper
use of ctype functions.
Diffstat (limited to 'charset.c')
-rw-r--r--charset.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/charset.c b/charset.c
index e6529be7..34a8f02c 100644
--- 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);
}