diff options
author | Mike Pall <mike> | 2016-02-26 17:59:43 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2016-02-26 18:03:08 +0100 |
commit | 18f6aa97fd93df8e9964c2d22f20f16e6b71b72b (patch) | |
tree | fad1176f6c01dc1aaf36bafa0b73f22b8e1c37e4 /src/lib_io.c | |
parent | 339a1fd69611e2fd084127ee11a36e57035639d1 (diff) | |
download | luajit-18f6aa97fd93df8e9964c2d22f20f16e6b71b72b.tar.gz luajit-18f6aa97fd93df8e9964c2d22f20f16e6b71b72b.tar.bz2 luajit-18f6aa97fd93df8e9964c2d22f20f16e6b71b72b.zip |
Use internal implementation for converting FP numbers to strings.
Contributed by Peter Cawley.
Diffstat (limited to 'src/lib_io.c')
-rw-r--r-- | src/lib_io.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib_io.c b/src/lib_io.c index 2aa83474..501de568 100644 --- a/src/lib_io.c +++ b/src/lib_io.c | |||
@@ -232,9 +232,8 @@ static int io_file_write(lua_State *L, FILE *fp, int start) | |||
232 | cTValue *tv; | 232 | cTValue *tv; |
233 | int status = 1; | 233 | int status = 1; |
234 | for (tv = L->base+start; tv < L->top; tv++) { | 234 | for (tv = L->base+start; tv < L->top; tv++) { |
235 | char buf[STRFMT_MAXBUF_NUM]; | ||
236 | MSize len; | 235 | MSize len; |
237 | const char *p = lj_strfmt_wstrnum(buf, tv, &len); | 236 | const char *p = lj_strfmt_wstrnum(L, tv, &len); |
238 | if (!p) | 237 | if (!p) |
239 | lj_err_argt(L, (int)(tv - L->base) + 1, LUA_TSTRING); | 238 | lj_err_argt(L, (int)(tv - L->base) + 1, LUA_TSTRING); |
240 | status = status && (fwrite(p, 1, len, fp) == len); | 239 | status = status && (fwrite(p, 1, len, fp) == len); |