Bug #10133 Updated: Some values returned by gmp_strval are null-terminated
| From: | elixer@php.net | Date: | Sun, 10 Feb 2002 23:16:06 +0000 |
| Subject: | Bug #10133 Updated: Some values returned by gmp_strval are null-terminated | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-84@lists.php.net to get a copy of this message | ||
ID: 10133
Updated by: elixer@php.net
Reported By: chr@tv2i.dk
-Status: Open
+Status: Closed
Bug Type: Math related
Operating System: Linux 2.2.16-3
PHP Version: 4.0.4pl1
New Comment:
This bug has been fixed in CVS.
Previous Comments:
------------------------------------------------------------------------
[2001-04-29 06:42:55] jmoore@php.net
reclassify
------------------------------------------------------------------------
[2001-04-03 07:13:01] chr@tv2i.dk
Some values returned by gmp_strval are padded with an additional \0
byte.
The code
for ($i = 0; $i < 20; $i++) {
$n = gmp_init($i);
$ns = gmp_strval($n);
print ord(substr($ns, -1)) . ' ';
}
outputs
48 49 50 51 52 53 54 55 0 0 48 49 50 51 52 53 54 55 56 57
where I would expect
48 49 50 51 52 53 54 55 56 57 48 49 50 51 52 53 54 55 56 57
This behavior is reproducible.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=10133&edit=1