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

libcitadel/lib/stringbuf.c

index 9804e5e4b6968f3feb7366d5cbb3d36dc3db4bbc..cdb625cc99b86b03eaa6cafce09554529209f314 100644 (file)
@@ -2563,7 +2563,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;
                }