size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len)
{
zend_string *res;
- char *tmpbuf = NULL;
+ char tmpbuf[MAX_LENGTH_OF_DOUBLE];
char *s, *t; /* source, target */
char *dp;
int integral;
dec = MAX(0, dec);
d = _php_math_round(d, dec, PHP_ROUND_HALF_UP);
- tmplen = spprintf(&tmpbuf, 0, "%.*F", dec, d);
+ tmplen = snprintf(tmpbuf, sizeof(tmpbuf), "%.*F", dec, d);
if (tmpbuf == NULL || !isdigit((int)tmpbuf[0])) {
-//??? return tmpbuf;
return STR_INIT(tmpbuf, tmplen, 0);
}
*t-- = '-';
}
- efree(tmpbuf);
-
res->len = reslen;
return res;
}