* same bug at StrBuf_Utf8StrLen too.
authorWilfried Göesgens <willi@citadel.org>
Tue, 10 Nov 2009 22:44:10 +0000 (22:44 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 10 Nov 2009 22:44:10 +0000 (22:44 +0000)
libcitadel/lib/stringbuf.c

index 6a08934aec2daf3f53d2fb055b128ed3c49c2f37..88c984ae5961e07f71e504856169d1c68a817108 100644 (file)
@@ -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;
 }