]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: utf8: remove compilator warning
authorThierry FOURNIER <tfournier@haproxy.com>
Thu, 12 Mar 2015 18:32:38 +0000 (19:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 13 Mar 2015 13:10:28 +0000 (14:10 +0100)
'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

index 79158ff8baba93eeae3372befbf0b2ca0c5937ca..c7060db47dc1280dae0844a1dbdcb4e4decbe293 100644 (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
         * 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))