@@ -495,7 +495,7 @@ static PHP_FUNCTION(bzcompress)
495
495
+ .01 x length of data + 600 which is the largest size the results of the compression
496
496
could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net
497
497
for pointing this out). */
498
- dest_len = source_len + (0.01 * source_len ) + 600 ;
498
+ dest_len = ( unsigned int ) ( source_len + (0.01 * source_len ) + 600 ) ;
499
499
500
500
/* Allocate the destination buffer */
501
501
dest = emalloc (dest_len + 1 );
@@ -559,15 +559,15 @@ static PHP_FUNCTION(bzdecompress)
559
559
/* compression is better then 2:1, need to allocate more memory */
560
560
bzs .avail_out = source_len ;
561
561
size = (bzs .total_out_hi32 * (unsigned int ) -1 ) + bzs .total_out_lo32 ;
562
- dest = safe_erealloc (dest , 1 , bzs .avail_out + 1 , size );
562
+ dest = safe_erealloc (dest , 1 , bzs .avail_out + 1 , ( size_t ) size );
563
563
bzs .next_out = dest + size ;
564
564
}
565
565
566
566
if (error == BZ_STREAM_END || error == BZ_OK ) {
567
567
size = (bzs .total_out_hi32 * (unsigned int ) -1 ) + bzs .total_out_lo32 ;
568
- dest = safe_erealloc (dest , 1 , size , 1 );
568
+ dest = safe_erealloc (dest , 1 , ( size_t ) size , 1 );
569
569
dest [size ] = '\0' ;
570
- RETVAL_STRINGL (dest , size , 0 );
570
+ RETVAL_STRINGL (dest , ( int ) size , 0 );
571
571
} else { /* real error */
572
572
efree (dest );
573
573
RETVAL_LONG (error );
0 commit comments