]> granicus.if.org Git - php/commitdiff
Fix unsigned comparisons
authorAnatol Belski <ab@php.net>
Sat, 17 Feb 2018 01:07:23 +0000 (02:07 +0100)
committerAnatol Belski <ab@php.net>
Sat, 17 Feb 2018 12:02:50 +0000 (13:02 +0100)
ext/mbstring/mb_gpc.c
ext/mbstring/mbstring.c

index 0cb06b8f6c0054370b31964ac0b71549271b1665..582a29f8657ff5daeb2265d7560ff6eb49ed7417 100644 (file)
@@ -261,7 +261,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
        num = n; /* make sure to process initialized vars only */
 
        /* initialize converter */
-       if (info->num_from_encodings <= 0) {
+       if (info->num_from_encodings == 0) {
                from_encoding = &mbfl_encoding_pass;
        } else if (info->num_from_encodings == 1) {
                from_encoding = info->from_encodings[0];
index 0fb57b0165b9b22e96a159c9574868dc3343ca5f..5f11a510aaba4cebb53e059caba690902e6708c4 100644 (file)
@@ -724,7 +724,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en
        const mbfl_encoding **entry, **list;
 
        list = NULL;
-       if (value == NULL || value_length <= 0) {
+       if (value == NULL || value_length == 0) {
                if (return_list) {
                        *return_list = NULL;
                }
@@ -3401,7 +3401,7 @@ PHP_FUNCTION(mb_detect_encoding)
                        }
                        break;
                }
-               if (size <= 0) {
+               if (size == 0) {
                        php_error_docref(NULL, E_WARNING, "Illegal argument");
                }
        }
@@ -3810,7 +3810,7 @@ PHP_FUNCTION(mb_convert_variables)
                        break;
        }
 
-       if (elistsz <= 0) {
+       if (elistsz == 0) {
                from_encoding = &mbfl_encoding_pass;
        } else if (elistsz == 1) {
                from_encoding = *elist;