From 53cc10e1c2684ddb42bba0b9d4c716372b1804d3 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sun, 18 Jul 2004 17:29:45 +0000 Subject: [PATCH] MFH: Fixed bug #28633 (sprintf incorrectly adding padding to floats). --- NEWS | 1 + ext/standard/formatted_print.c | 3 --- ext/standard/tests/strings/bug22207.phpt | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) 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 " -- 2.50.1