diff options
author | Mark Pulford <mark@kyne.com.au> | 2012-01-01 15:24:30 +1030 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2012-01-01 15:24:30 +1030 |
commit | 929c814b12e3575859fa0d5a8ea9950ae2187c56 (patch) | |
tree | c953eadc2fe8415ca85bf15175b6c3114fbc0622 /lua | |
parent | 4ce40cdccf28551f4b091cb8f9a735c2cc9f5513 (diff) | |
download | lua-cjson-929c814b12e3575859fa0d5a8ea9950ae2187c56.tar.gz lua-cjson-929c814b12e3575859fa0d5a8ea9950ae2187c56.tar.bz2 lua-cjson-929c814b12e3575859fa0d5a8ea9950ae2187c56.zip |
Sanitise locale code, comments and documentation
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); |