From bd1ab50db89a2298bc0808a7934e7ebe75e848e3 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 12 Jul 2016 15:16:56 +0200 Subject: rfc2047: avoid tolower --- rfc2047.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'rfc2047.c') diff --git a/rfc2047.c b/rfc2047.c index 436aef0..e90b91b 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -7,6 +7,9 @@ #define iswsp(c) (((c) == ' ' || (c) == '\t')) +// ASCII lowercase without alpha check (wrong for "@[\]^_") +#define lc(c) ((c) | 0x20) + // XXX error detection on decode // XXX keep trying bytewise on invalid iconv @@ -141,7 +144,7 @@ blaze822_decode_rfc2047(char *dst, char *src, size_t dlen, char *tgtenc) goto nocode; } - char enc = tolower(*e++); + char enc = lc(*e++); if (*e++ != '?') goto nocode; char *start = e++; -- cgit 1.4.1