diff options
Diffstat (limited to '')
-rw-r--r-- | lua_cjson.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lua_cjson.c b/lua_cjson.c index fe6d41a..175433a 100644 --- a/lua_cjson.c +++ b/lua_cjson.c | |||
@@ -571,8 +571,6 @@ static void json_append_number(lua_State *l, json_config_t *cfg, | |||
571 | /* Some platforms may print -nan, just hard code it */ | 571 | /* Some platforms may print -nan, just hard code it */ |
572 | strbuf_append_mem(json, "nan", 3); | 572 | strbuf_append_mem(json, "nan", 3); |
573 | } else { | 573 | } else { |
574 | /* Longest double printed with %.14g is 21 characters long: | ||
575 | * -1.7976931348623e+308 */ | ||
576 | strbuf_ensure_empty_length(json, FPCONV_G_FMT_BUFSIZE); | 574 | strbuf_ensure_empty_length(json, FPCONV_G_FMT_BUFSIZE); |
577 | len = fpconv_g_fmt(strbuf_empty_ptr(json), num, cfg->encode_number_precision); | 575 | len = fpconv_g_fmt(strbuf_empty_ptr(json), num, cfg->encode_number_precision); |
578 | strbuf_extend_length(json, len); | 576 | strbuf_extend_length(json, len); |
@@ -1283,9 +1281,8 @@ static int lua_cjson_new(lua_State *l) | |||
1283 | { NULL, NULL } | 1281 | { NULL, NULL } |
1284 | }; | 1282 | }; |
1285 | 1283 | ||
1286 | /* Update the current locale for g_fmt/strtod. | 1284 | /* Initialise number conversions */ |
1287 | * Using different locales per-thread is not supported. */ | 1285 | fpconv_init(); |
1288 | fpconv_update_locale(); | ||
1289 | 1286 | ||
1290 | /* cjson module table */ | 1287 | /* cjson module table */ |
1291 | lua_newtable(l); | 1288 | lua_newtable(l); |