summaryrefslogtreecommitdiff
path: root/ext/standard/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r--ext/standard/math.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index b3e8c6f086..6e934a3857 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1120,6 +1120,10 @@ static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point,
tmplen = spprintf(&tmpbuf, 0, "%.*F", dec, d);
if (tmpbuf == NULL || !isdigit((int)tmpbuf[0])) {
+ if (result_len) {
+ *result_len = tmplen;
+ }
+
return tmpbuf;
}