From: Ilia Alshanetsky Date: Fri, 22 Dec 2006 15:29:41 +0000 (+0000) Subject: Fixed bug #36392 (wrong number of decimal digits with %e specifier in X-Git-Tag: php-5.2.1RC2~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f40ebf41711f9e5fe3b822dc8de7ac3a8f0edf15;p=php Fixed bug #36392 (wrong number of decimal digits with %e specifier in sprintf). --- diff --git a/NEWS b/NEWS index ba989b71ae..9166ab0179 100644 --- a/NEWS +++ b/NEWS @@ -16,7 +16,6 @@ PHP NEWS __inet_pton() and inet_ntop() was named __inet_ntop(). (Hannes) - Fixed the validate email filter so that the letter "v" can also be used in the user part of the email address. (Derick) - - Fixed bug #39903 (Notice message when executing __halt_compiler() more than once). (Tony) - Fixed bug #39898 (FILTER_VALIDATE_URL validates \r\n\t etc). (Ilia) @@ -31,6 +30,8 @@ PHP NEWS - Fixed bug #39815 (SOAP double encoding is not locale-independent). (Dmitry) - Fixed bug #39685 (iconv() - undefined function). (Hannes) - Fixed bug #38852 (XML-RPC Breaks iconv). (Hannes) +- Fixed bug #36392 (wrong number of decimal digits with %e specifier in + sprintf). (Matt,Ilia) 14 Dec 2006, PHP 5.2.1RC1 - Added a meta tag to phpinfo() output to prevent search engines from indexing diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 8add3bbddf..50efb00b1b 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -229,9 +229,6 @@ php_sprintf_appenddouble(char **buffer, int *pos, switch (fmt) { case 'e': - if (precision) { - precision--; - } case 'E': case 'f': case 'F': diff --git a/ext/standard/tests/strings/bug36392.phpt b/ext/standard/tests/strings/bug36392.phpt new file mode 100644 index 0000000000..8e4cd16c67 --- /dev/null +++ b/ext/standard/tests/strings/bug36392.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #36392 (wrong number of decimal digits with %e specifier in sprintf) +--FILE-- + +--EXPECT-- +1.123457e+0 +1.1234567890e+0 +1e+0 +1.1e+0 +1.1e+0