Use internal implementation for converting FP numbers to strings.

Contributed by Peter Cawley.
This commit is contained in:
Mike Pall
2016-02-26 17:59:43 +01:00
parent 339a1fd696
commit 18f6aa97fd
11 changed files with 627 additions and 121 deletions

View File

@@ -495,11 +495,10 @@ LJLIB_CF(print)
shortcut = (tvisfunc(tv) && funcV(tv)->c.ffid == FF_tostring);
for (i = 0; i < nargs; i++) {
cTValue *o = &L->base[i];
char buf[STRFMT_MAXBUF_NUM];
const char *str;
size_t size;
MSize len;
if (shortcut && (str = lj_strfmt_wstrnum(buf, o, &len)) != NULL) {
if (shortcut && (str = lj_strfmt_wstrnum(L, o, &len)) != NULL) {
size = len;
} else {
copyTV(L, L->top+1, o);