summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--utf8.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/utf8.c b/utf8.c
index ddff417..dfaba2c 100644
--- a/utf8.c
+++ b/utf8.c
@@ -152,14 +152,14 @@ utf8_interpret(char * s, langinfo_t * langinfo)
int
utf8_get_length(unsigned char c)
{
- if (c >= 0xf0)
- return 4;
- else if (c >= 0xe0)
- return 3;
- else if (c >= 0xc2)
+ if (c < 0x80)
+ return 1;
+ else if (c < 0xe0)
return 2;
+ else if (c < 0xf0)
+ return 3;
else
- return 1;
+ return 4;
}
/* ================================================== */