X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Fstringbuf.c;h=df35593ea49d7f9ee3db0d50b058b6f652ae7672;hb=99a9608c07d628bc1db89cddf98d5f4a2ff7bbb2;hp=8718ec065a68ac6e38913def4fc30a84226c75da;hpb=6d77e7946f7f1143c8ce75f9cbf2f6ddbab5e57a;p=citadel.git diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index 8718ec065..df35593ea 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -3179,7 +3179,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) && @@ -3202,7 +3202,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); } /**