From 2e5e31c6b8c3912a3fbefad6041c00d59bd4ca4b Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 22 Dec 2006 15:30:18 +0000 Subject: [PATCH] MFB: Fixed bug #36392 (wrong number of decimal digits with %e specifier in sprintf). --- ext/standard/formatted_print.c | 3 --- ext/standard/tests/strings/bug36392.phpt | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 ext/standard/tests/strings/bug36392.phpt diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index b031bc8513..11ea8454e1 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -368,9 +368,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 -- 2.50.1