summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-12 15:16:56 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-12 15:16:56 +0200
commitbd1ab50db89a2298bc0808a7934e7ebe75e848e3 (patch)
treeaf6d94207a253e28038a80a5ac29d67a314c888a
parentd299649b0c458730e7c7068a2c97574039cd26fe (diff)
downloadmblaze-bd1ab50db89a2298bc0808a7934e7ebe75e848e3.tar.gz
mblaze-bd1ab50db89a2298bc0808a7934e7ebe75e848e3.tar.xz
mblaze-bd1ab50db89a2298bc0808a7934e7ebe75e848e3.zip
rfc2047: avoid tolower
-rw-r--r--rfc2047.c5
1 files changed, 4 insertions, 1 deletions
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++;