summaryrefslogtreecommitdiff
path: root/sapi/cli/php_http_parser.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-10-09 09:03:37 +0200
committerAnatol Belski <ab@php.net>2014-10-10 19:00:18 +0200
commit6075e5a549dea536f022a6289ee75ecb7a54ce02 (patch)
tree96b52069666d8ab0c332516b35d5bae0d6fa5e34 /sapi/cli/php_http_parser.c
parent3942ed52bed9bdddf67e0a4df50ee3d8d5139001 (diff)
downloadphp-git-6075e5a549dea536f022a6289ee75ecb7a54ce02.tar.gz
fix signed/unsigned mismatch warning
Diffstat (limited to 'sapi/cli/php_http_parser.c')
-rw-r--r--sapi/cli/php_http_parser.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c
index d3bc496f4e..cc649af79a 100644
--- a/sapi/cli/php_http_parser.c
+++ b/sapi/cli/php_http_parser.c
@@ -1431,7 +1431,9 @@ size_t php_http_parser_execute (php_http_parser *parser,
}
case s_body_identity:
- to_read = MIN(pe - p, (size_t)parser->content_length);
+ assert(pe >= p);
+
+ to_read = MIN((size_t)(pe - p), (size_t)parser->content_length);
if (to_read > 0) {
if (settings->on_body) settings->on_body(parser, p, to_read);
p += to_read - 1;
@@ -1515,8 +1517,9 @@ size_t php_http_parser_execute (php_http_parser *parser,
case s_chunk_data:
{
assert(parser->flags & F_CHUNKED);
+ assert(pe >= p);
- to_read = MIN(pe - p, (size_t)(parser->content_length));
+ to_read = MIN((size_t)(pe - p), (size_t)(parser->content_length));
if (to_read > 0) {
if (settings->on_body) settings->on_body(parser, p, to_read);