From: Wilfried Göesgens Date: Tue, 10 Nov 2009 22:44:10 +0000 (+0000) Subject: * same bug at StrBuf_Utf8StrLen too. X-Git-Tag: v7.86~625 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=296f1d3fd618ae66e50d83b8b7c9d9f35b979e5b * same bug at StrBuf_Utf8StrLen too. --- diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index 6a08934ae..88c984ae5 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -3384,14 +3384,13 @@ long StrBuf_Utf8StrLen(StrBuf *Buf) while ((aptr < eptr) && (*aptr != '\0')) { if (Ctdl_IsUtf8SequenceStart(*aptr)){ m = Ctdl_GetUtf8SequenceLength(aptr, eptr); - while ((aptr < eptr) && (m-- > 0) && (*aptr++ != '\0')) - n ++; + while ((aptr < eptr) && (*aptr++ != '\0')&& (m-- > 0) ); + n ++; } else { n++; aptr++; } - } return n; }