]> granicus.if.org Git - php/commitdiff
fix size_t signed comparison
authorJoe Watkins <krakjoe@php.net>
Fri, 29 Apr 2016 09:19:55 +0000 (10:19 +0100)
committerJoe Watkins <krakjoe@php.net>
Fri, 29 Apr 2016 09:19:55 +0000 (10:19 +0100)
ext/readline/readline_cli.c
sapi/cli/php_cli.c

index 3332fa56e0a65fe61db8da6c0698bcb78a4381d8..a90b1387df2bf61d5d5ebf2309f88d855326586d 100644 (file)
@@ -106,7 +106,8 @@ static size_t readline_shell_ub_write(const char *str, size_t str_length) /* {{{
           caller (sapi_cli_single_write in sapi/cli) which will actually
           write due to -1 return code */
        php_last_char = str[str_length-1];
-       return -1;
+
+       return (size_t) -1;
 }
 /* }}} */
 
index 5d789d2626de264a960362a34bee2dfee54ac8cf..978c8b332e34d236d05d82232dd1c690d6b64ee2 100644 (file)
@@ -304,7 +304,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length) /* {{{ */
        if (cli_shell_callbacks.cli_shell_ub_write) {
                size_t ub_wrote;
                ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length);
-               if (ub_wrote > -1) {
+               if (ub_wrote != (size_t) -1) {
                        return ub_wrote;
                }
        }