Skip to content

Commit dbae165

Browse files
committed
fix size_t signed comparison
1 parent a571853 commit dbae165

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ext/readline/readline_cli.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ static size_t readline_shell_ub_write(const char *str, size_t str_length) /* {{{
106106
caller (sapi_cli_single_write in sapi/cli) which will actually
107107
write due to -1 return code */
108108
php_last_char = str[str_length-1];
109-
return -1;
109+
110+
return (size_t) -1;
110111
}
111112
/* }}} */
112113

sapi/cli/php_cli.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static size_t sapi_cli_ub_write(const char *str, size_t str_length) /* {{{ */
304304
if (cli_shell_callbacks.cli_shell_ub_write) {
305305
size_t ub_wrote;
306306
ub_wrote = cli_shell_callbacks.cli_shell_ub_write(str, str_length);
307-
if (ub_wrote > -1) {
307+
if (ub_wrote != (size_t) -1) {
308308
return ub_wrote;
309309
}
310310
}

0 commit comments

Comments
 (0)