X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=libcitadel%2Flib%2Fstringbuf.c;fp=libcitadel%2Flib%2Fstringbuf.c;h=134ff47794a32e8790522a25d75a3e80b1bff960;hp=baa9c69a79ea8a5df0e58e8e2096a93a567f8f0f;hb=18fbb7fd6c46411584245b1b30bbb9077bdd16c9;hpb=d558c9f6ddf418b3f61a09fb84b8ff4ab044c44f diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index baa9c69a7..134ff4779 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -2006,32 +2006,13 @@ void StrBufXMLEscAppend(StrBuf *OutBuf, *pt = *pch; pt++; pch++; } - else if (*pch < 0x20) { - /* we probably shouldn't be doing this */ - if (OverrideLowChars) - { - *pt = '_'; - pt ++; - pch ++; - } - else - { - *pt = '&'; - pt++; - *pt = HexList[*(unsigned char*)pch][0]; - pt ++; - *pt = HexList[*(unsigned char*)pch][1]; - pt ++; pch ++; - *pt = '&'; - pt++; - pch ++; - } - } else { IsUtf8Sequence = Ctdl_GetUtf8SequenceLength(pch, pche); if (IsUtf8Sequence) { - while (IsUtf8Sequence > 0){ + while ((IsUtf8Sequence > 0) && + (pch < pche)) + { *pt = *pch; pt ++; pch ++;