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
This commit is contained in:
Thierry FOURNIER 2015-03-12 19:32:38 +01:00 committed by Willy Tarreau
parent 7f4942a978
commit 9e7ec08976

View File

@ -2659,7 +2659,7 @@ unsigned char utf8_next(const char *s, int len, unsigned int *c)
* 2 bytes : 4 + 6 + 6 : 16 : 0x800 ... 0xffff * 2 bytes : 4 + 6 + 6 : 16 : 0x800 ... 0xffff
* 3 bytes : 3 + 6 + 6 + 6 : 21 : 0x10000 ... 0x1fffff * 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 >= 0x80 && *c <= 0x7ff && (p-(unsigned char *)s) > 2) ||
(*c >= 0x800 && *c <= 0xffff && (p-(unsigned char *)s) > 3) || (*c >= 0x800 && *c <= 0xffff && (p-(unsigned char *)s) > 3) ||
(*c >= 0x10000 && *c <= 0x1fffff && (p-(unsigned char *)s) > 4)) (*c >= 0x10000 && *c <= 0x1fffff && (p-(unsigned char *)s) > 4))