com php-src: fix signed/unsigned mismatch warning: sapi/cli/php _http_parser.c
| From: | Anatol Belski | Date: | Fri, 10 Oct 2014 17:00:18 +0000 |
| Subject: | com php-src: fix signed/unsigned mismatch warning: sapi/cli/php _http_parser.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82248@lists.php.net to get a copy of this message | ||
Commit: 6075e5a549dea536f022a6289ee75ecb7a54ce02
Author: Anatol Belski <ab@php.net> Thu, 9 Oct 2014 09:03:37 +0200
Parents: 3942ed52bed9bdddf67e0a4df50ee3d8d5139001
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6075e5a549dea536f022a6289ee75ecb7a54ce02
Log:
fix signed/unsigned mismatch warning
Changed paths:
M sapi/cli/php_http_parser.c
Diff:
diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c
index d3bc496..cc649af 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);