From 8629e12ee6f31750f91c78cbdf4e9c45908ae4c3 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Fri, 15 Jul 2016 16:39:11 +0200 Subject: rfc2047: revert in blaze822_decode_b64 --- rfc2047.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'rfc2047.c') diff --git a/rfc2047.c b/rfc2047.c index 39925cc..f942a46 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -90,31 +90,18 @@ blaze822_decode_b64(char *s, char *e, char **deco, size_t *decleno) if ((c0 | c1 | c2 | c3) > 127) continue; -// V 21098765432109876543210 -// [[[c0]]]543210 -// [[[c1]]]543210 -// [[[c2]]]543210 -// [[[c3]]] -// [[[d2]]][[[d1]]][[[d0]]] - -#ifndef SLICE v |= b64[c0]; t |= b64[c0]; v <<= 6; v |= b64[c1]; t |= b64[c1]; v <<= 6; v |= b64[c2]; t |= b64[c2]; v <<= 6; v |= b64[c3]; t |= b64[c3]; - if (t => 64) + if (t >= 64) continue; char d2 = v & 0xff; v >>= 8; char d1 = v & 0xff; v >>= 8; char d0 = v & 0xff; -#else - if ((b64[c0] | b64[c1] | b64[c2] | b64[c3]) >= 64) continue; - char d0 = (b64[c0] << 2) | (b64[c1] >> 4); - char d1 = ((b64[c1] & 0x0f) << 4) | (b64[c2] >> 2); - char d2 = ((b64[c2] & 0x03) << 6) | b64[c3]; -#endif + if (c1 != '=') *buf++ = d0; if (c2 != '=') *buf++ = d1; if (c3 != '=') *buf++ = d2; -- cgit 1.4.1