From 9e7ec0897677d434ab9de4a58da30cbf8216b2e5 Mon Sep 17 00:00:00 2001 From: Thierry FOURNIER Date: Thu, 12 Mar 2015 19:32:38 +0100 Subject: [PATCH] BUG/MINOR: utf8: remove compilator warning 'c' is an unsigned int, obviously it is '>= 0'. This patch remove the '>= 0' test. this bug is repported by Dmitry Sivachenko --- src/standard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/standard.c b/src/standard.c index 79158ff8b..c7060db47 100644 --- a/src/standard.c +++ b/src/standard.c @@ -2659,7 +2659,7 @@ unsigned char utf8_next(const char *s, int len, unsigned int *c) * 2 bytes : 4 + 6 + 6 : 16 : 0x800 ... 0xffff * 3 bytes : 3 + 6 + 6 + 6 : 21 : 0x10000 ... 0x1fffff */ - if ((*c >= 0x00 && *c <= 0x7f && (p-(unsigned char *)s) > 1) || + if (( *c <= 0x7f && (p-(unsigned char *)s) > 1) || (*c >= 0x80 && *c <= 0x7ff && (p-(unsigned char *)s) > 2) || (*c >= 0x800 && *c <= 0xffff && (p-(unsigned char *)s) > 3) || (*c >= 0x10000 && *c <= 0x1fffff && (p-(unsigned char *)s) > 4))