From 711bd0a0fcd681df5d03d3b869fc3ddc7db1a75b Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 13 Sep 2019 11:37:53 +0100 Subject: [PATCH] Fix tautological compare warning 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. --- ext/standard/image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/image.c b/ext/standard/image.c index 53c42a0e51..aaaf81ae9e 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -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; } -- 2.50.1