PHP 4.0 Bug #9503 Updated: bzcompress output is null padded to size of original string
| From: | sniper@php.net | Date: | Fri, 16 Mar 2001 01:27:29 +0000 |
| Subject: | PHP 4.0 Bug #9503 Updated: bzcompress output is null padded to size of original string | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-49021@lists.php.net to get a copy of this message | ||
ID: 9503
Updated by: sniper
Reported By: zeekamotay@hotmail.com
Old-Status: Open
Status: Closed
Bug Type: Bzip2 Related
Assigned To:
Comments:
Fixed in CVS.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2001-02-28 16:58:45] zeekamotay@hotmail.com
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
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9503&edit=2