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

@@ -232,9 +232,8 @@ static int io_file_write(lua_State *L, FILE *fp, int start)
cTValue *tv;
int status = 1;
for (tv = L->base+start; tv < L->top; tv++) {
char buf[STRFMT_MAXBUF_NUM];
MSize len;
const char *p = lj_strfmt_wstrnum(buf, tv, &len);
const char *p = lj_strfmt_wstrnum(L, tv, &len);
if (!p)
lj_err_argt(L, (int)(tv - L->base) + 1, LUA_TSTRING);
status = status && (fwrite(p, 1, len, fp) == len);