no exponent).
Added a test case for the bug.
numbuf[i++] = fmt;
exp_p = php_convert_to_decimal(decpt, 0, &dec2, &sign, 0);
numbuf[i++] = sign ? '-' : '+';
- while (*exp_p) {
- numbuf[i++] = *(exp_p++);
+ if (*exp_p) {
+ while (*exp_p) {
+ numbuf[i++] = *(exp_p++);
+ }
+ } else {
+ numbuf[i++] = '0';
}
} else {
numbuf[i++] = cvt[j++];
--- /dev/null
+--TEST--
+Bug #22207 (missing 0 when using the e notation in *printf functions)
+--FILE--
+<?php
+ printf("%10.5e\n", 1.1);
+ var_dump(sprintf("%10.5e\n", 1.1));
+?>
+--EXPECT--
+1.1000e+0
+string(17) " 1.1000e+0
+"