X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Fstringbuf.c;h=02b715397725f29a23d8c9cd69096f351a98c9dc;hb=ceac59570da7c88bbe4d8e82b5396bcc19552c8d;hp=aadd92d1913ad957b2beb79cf2ccf3da2d69cb37;hpb=d6a268eae59b4355daf9e5b32d097530e24566e7;p=citadel.git diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index aadd92d19..02b715397 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -3331,7 +3331,7 @@ static inline int Ctdl_GetUtf8SequenceLength(const char *CharS, const char *Char int n = 0; unsigned char test = (1<<7); - if ((*CharS & 0xC0) == 0) + if ((*CharS & 0xC0) != 0xC0) return 1; while ((n < 8) && @@ -3354,7 +3354,7 @@ static inline int Ctdl_GetUtf8SequenceLength(const char *CharS, const char *Char static inline int Ctdl_IsUtf8SequenceStart(const char Char) { /** 11??.???? indicates an UTF8 Sequence. */ - return ((Char & 0xC0) != 0); + return ((Char & 0xC0) == 0xC0); } /**