From:             [EMAIL PROTECTED]
Operating system: Linux 2.2 [RH6.2]
PHP version:      4.0.4pl1
PHP Bug Type:     Bzip2 Related
Bug description:  bzcompress output is null padded to size of original string

I compiled PHP 4.0.4pl1 with --bz2, using bzip 1.0.1. Running bzcompress() on a string 
always returns a string of the same size. The data in the returned string appears to 
be correctlty compressed though, as it uncompresses correctly when passed back to 
bzdecompress(). It appears that the first part of the returned string contains the 
correctly compressed result, and that the returned string is then padded with nulls 
out to the size of the original string. The gzcompress() function does not behave this 
way.

<?
$str = "[...some really huge string...]";
echo
  strlen($str) . " " .
  strlen(gzcompress($str,9)) . " " .
  strlen(bzcompress($str,9));
?>

This generates the output: 14092 2348 14092


-- 
Edit Bug report at: http://bugs.php.net/?id=9503&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to