Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
3d14530b
Commit
3d14530b
authored
Mar 18, 2015
by
funshine
Browse files
fix cjson.encode() when in integer version
parent
3aead6d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/cjson/fpconv.c
View file @
3d14530b
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "fpconv.h"
#include "fpconv.h"
#if 0
/* Lua CJSON assumes the locale is the same for all threads within a
/* Lua CJSON assumes the locale is the same for all threads within a
* process and doesn't change after initialisation.
* process and doesn't change after initialisation.
*
*
...
@@ -203,6 +204,6 @@ void fpconv_init()
...
@@ -203,6 +204,6 @@ void fpconv_init()
{
{
fpconv_update_locale();
fpconv_update_locale();
}
}
#endif
/* vi:ai et sw=4 ts=4:
/* vi:ai et sw=4 ts=4:
*/
*/
app/modules/cjson.c
View file @
3d14530b
...
@@ -772,7 +772,7 @@ static void json_append_number(lua_State *l, json_config_t *cfg,
...
@@ -772,7 +772,7 @@ static void json_append_number(lua_State *l, json_config_t *cfg,
strbuf_ensure_empty_length
(
json
,
FPCONV_G_FMT_BUFSIZE
);
strbuf_ensure_empty_length
(
json
,
FPCONV_G_FMT_BUFSIZE
);
// len = fpconv_g_fmt(strbuf_empty_ptr(json), num, cfg->encode_number_precision);
// len = fpconv_g_fmt(strbuf_empty_ptr(json), num, cfg->encode_number_precision);
c_sprintf
(
strbuf_empty_ptr
(
json
),
LUA_NUMBER_FMT
,
num
);
c_sprintf
(
strbuf_empty_ptr
(
json
),
LUA_NUMBER_FMT
,
(
LUA_NUMBER
)
num
);
len
=
c_strlen
(
strbuf_empty_ptr
(
json
));
len
=
c_strlen
(
strbuf_empty_ptr
(
json
));
strbuf_extend_length
(
json
,
len
);
strbuf_extend_length
(
json
,
len
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment