From 5ff71ace36fb4d2962b5b8f2085aceaf841eaff1 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 27 Sep 2017 14:42:54 +0200 Subject: rfc2047: blaze822_decode_qp: decode invalid qp-codes as literal --- rfc2047.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rfc2047.c') diff --git a/rfc2047.c b/rfc2047.c index 0d5bea5..6d4760a 100644 --- a/rfc2047.c +++ b/rfc2047.c @@ -41,9 +41,9 @@ blaze822_decode_qp(char *start, char *stop, char **deco, size_t *decleno, int un unsigned char c2 = s[2]; s += 3; if (c1 > 127 || c2 > 127 || hex[c1] < 0 || hex[c2] < 0) { - *buf++ = '?'; - *buf++ = '?'; - *buf++ = '?'; + *buf++ = '='; + *buf++ = c1; + *buf++ = c2; continue; } *buf++ = (hex[c1] << 4) | hex[c2]; -- cgit 1.4.1