Skip to content

Commit

Permalink
Fix tautological compare warning
Browse files Browse the repository at this point in the history
The ZEND_ALLOCATOR() macro compares against constants that are
larger than the unsigned short type, resulting in warnings on
clang. Avoid this by explicitly casting to size_t.
  • Loading branch information
devnexen authored and nikic committed Sep 13, 2019
1 parent ee0bf4b commit 711bd0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/standard/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info)
}
length -= 2; /* length includes itself */

buffer = emalloc(length);
buffer = emalloc((size_t)length);

if (php_stream_read(stream, buffer, (zend_long) length) != length) {
if (php_stream_read(stream, buffer, (size_t) length) != length) {
efree(buffer);
return 0;
}
Expand Down

0 comments on commit 711bd0a

Please sign in to comment.