fix QP encoding
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 18 Aug 2011 09:14:48 +0000 (09:14 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 18 Aug 2011 10:45:42 +0000 (10:45 +0000)
 - once we decided to QP encode we also need to encode =[]

libcitadel/lib/stringbuf.c

index 7a841df8f255fcdbfd5c20348639aa2387348a18..114b453e4487849e4a19ee7be996c41a9d4975f5 100644 (file)
@@ -2434,7 +2434,12 @@ int StrBufRFC2047encode(StrBuf **target, const StrBuf *source)
                if ((*target)->BufUsed + 4 >= (*target)->BufSize)
                        IncreaseBuf(*target, 1, 0);
                ch = (unsigned char) source->buf[i];
-               if ((ch < 32) || (ch > 126) || (ch == 61)) {
+               if ((ch  <  32) || 
+                   (ch  > 126) || 
+                   (ch ==  61) ||
+                   (ch == '[') ||
+                   (ch == ']')   )
+               {
                        sprintf(&(*target)->buf[(*target)->BufUsed], "=%02X", ch);
                        (*target)->BufUsed += 3;
                }