@@ -493,11 +493,7 @@ PHP_FUNCTION(bzdecompress)
493
493
size_t source_len ;
494
494
int error ;
495
495
bool small = 0 ;
496
- #ifdef PHP_WIN32
497
- unsigned __int64 size = 0 ;
498
- #else
499
496
unsigned long long size = 0 ;
500
- #endif
501
497
bz_stream bzs ;
502
498
503
499
if (FAILURE == zend_parse_parameters (ZEND_NUM_ARGS (), "s|b" , & source , & source_len , & small )) {
@@ -524,7 +520,7 @@ PHP_FUNCTION(bzdecompress)
524
520
/* compression is better then 2:1, need to allocate more memory */
525
521
bzs .avail_out = source_len ;
526
522
size = (bzs .total_out_hi32 * (unsigned int ) -1 ) + bzs .total_out_lo32 ;
527
- #ifndef ZEND_ENABLE_ZVAL_LONG64
523
+ #if SIZEOF_LONG_LONG > SIZEOF_SIZE_T
528
524
if (size > SIZE_MAX ) {
529
525
/* no reason to continue if we're going to drop it anyway */
530
526
break ;
@@ -536,9 +532,9 @@ PHP_FUNCTION(bzdecompress)
536
532
537
533
if (error == BZ_STREAM_END || error == BZ_OK ) {
538
534
size = (bzs .total_out_hi32 * (unsigned int ) -1 ) + bzs .total_out_lo32 ;
539
- #ifndef ZEND_ENABLE_ZVAL_LONG64
535
+ #if SIZEOF_LONG_LONG > SIZEOF_SIZE_T
540
536
if (UNEXPECTED (size > SIZE_MAX )) {
541
- php_error_docref (NULL , E_WARNING , "Decompressed size too big, max is %zd " , SIZE_MAX );
537
+ php_error_docref (NULL , E_WARNING , "Decompressed size too big, max is %zu " , SIZE_MAX );
542
538
zend_string_efree (dest );
543
539
RETVAL_LONG (BZ_MEM_ERROR );
544
540
} else
0 commit comments