Skip to content

Commit 711bd0a

Browse files
devnexennikic
authored andcommitted
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.
1 parent ee0bf4b commit 711bd0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/standard/image.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info)
449449
}
450450
length -= 2; /* length includes itself */
451451

452-
buffer = emalloc(length);
452+
buffer = emalloc((size_t)length);
453453

454-
if (php_stream_read(stream, buffer, (zend_long) length) != length) {
454+
if (php_stream_read(stream, buffer, (size_t) length) != length) {
455455
efree(buffer);
456456
return 0;
457457
}

0 commit comments

Comments
 (0)