]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #28633 (sprintf incorrectly adding padding to floats).
authorIlia Alshanetsky <iliaa@php.net>
Sun, 18 Jul 2004 17:29:45 +0000 (17:29 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 18 Jul 2004 17:29:45 +0000 (17:29 +0000)
NEWS
ext/standard/formatted_print.c
ext/standard/tests/strings/bug22207.phpt

diff --git a/NEWS b/NEWS
index 8298c2a9796c1c3fe2f501aceb85b758d9caef0b..2f9b960a032acce5e7bda90cd4281a82a1b80724 100644 (file)
--- 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
index 32f4213e951c960932b0d3dde0ebfbf7768ac502..6252376f7500dae169d63876bd25a5be5f795f2e 100644 (file)
@@ -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);
 }
index 1623fb8e41a0a771e18e8cfc21ee6993d651df71..688bb5b74493ea2f8fd2a0246b589284d0b74ac6 100644 (file)
@@ -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
 "