From: FreeBirdLjj Date: Wed, 24 Sep 2014 17:05:56 +0000 (+0800) Subject: Use is_utf8() instead, for more readable. X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=a64de8af30f7a0465333e65f365dfa02ad2862b6;p=smdp.git Use is_utf8() instead, for more readable. --- diff --git a/src/parser.c b/src/parser.c index 6f5c4c8..478da5b 100644 --- a/src/parser.c +++ b/src/parser.c @@ -382,7 +382,7 @@ int length_utf8(char ch) { int i = 0; // increment - while(ch & 0x80) { + while(is_utf8(ch)) { i++; ch <<= 1; }