From: Ilia Alshanetsky Date: Sun, 18 Jul 2004 17:29:45 +0000 (+0000) Subject: MFH: Fixed bug #28633 (sprintf incorrectly adding padding to floats). X-Git-Tag: php-4.3.9RC1~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=53cc10e1c2684ddb42bba0b9d4c716372b1804d3;p=php MFH: Fixed bug #28633 (sprintf incorrectly adding padding to floats). --- diff --git a/NEWS b/NEWS index 8298c2a979..2f9b960a03 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,7 @@ PHP 4 NEWS (Ilia) - Fixed bug #28649 (Proper glob() return value on Linux when there are no matches). (Ilia) +- Fixed bug #28633 (sprintf incorrectly adding padding to floats). (Ilia) - Fixed bug #28627 (When multiple MySQL links are used default link is leaked). (gavin at ipalsoftware dot com, Ilia) - Fixed bug #28525 (gmp_powm() does not work with hexadecimal string modulo diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 32f4213e95..6252376f75 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -398,9 +398,6 @@ php_sprintf_appenddouble(char **buffer, int *pos, numbuf[i] = '\0'; - if (precision > 0) { - width += (precision + 1); - } php_sprintf_appendstring(buffer, pos, size, numbuf, width, 0, padding, alignment, i, sign, 0, always_sign); } diff --git a/ext/standard/tests/strings/bug22207.phpt b/ext/standard/tests/strings/bug22207.phpt index 1623fb8e41..688bb5b744 100644 --- a/ext/standard/tests/strings/bug22207.phpt +++ b/ext/standard/tests/strings/bug22207.phpt @@ -7,5 +7,5 @@ Bug #22207 (missing 0 when using the e notation in *printf functions) ?> --EXPECT-- 1.1000e+0 -string(17) " 1.1000e+0 +string(11) " 1.1000e+0 "