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
96d8047f
Commit
96d8047f
authored
Sep 22, 2020
by
philip
Committed by
Nathaniel Wesley Filardo
Sep 27, 2020
Browse files
Give it a chance of working under Lua 5.1
parent
df9f3030
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/lua53/luaconf.h
View file @
96d8047f
...
...
@@ -401,7 +401,7 @@
@@ l_sprintf is equivalent to 'snprintf' or 'sprintf' in C89.
** (All uses in Lua have only one format item.)
*/
#if !defined(LUA_USE_C89)
&& !
defined(LUA_USE_ESP8266)
#if !defined(LUA_USE_C89)
||
defined(LUA_USE_ESP8266)
#define l_sprintf(s,sz,f,i) snprintf(s,sz,f,i)
#else
#define l_sprintf(s,sz,f,i) ((void)(sz), sprintf(s,f,i))
...
...
app/modules/sjson.c
View file @
96d8047f
...
...
@@ -725,9 +725,9 @@ static void encode_lua_object(lua_State *L, ENC_DATA *data, int argno, const cha
char
value
[
50
];
if
(
lua_isinteger
(
L
,
-
1
))
{
l_
sprintf
(
value
,
sizeof
(
value
),
LUA_INTEGER_FMT
,
lua_tointeger
(
L
,
-
1
));
s
n
printf
(
value
,
sizeof
(
value
),
LUA_INTEGER_FMT
,
lua_tointeger
(
L
,
-
1
));
}
else
{
l_
sprintf
(
value
,
sizeof
(
value
),
SJSON_FLOAT_FMT
,
lua_tonumber
(
L
,
-
1
));
s
n
printf
(
value
,
sizeof
(
value
),
SJSON_FLOAT_FMT
,
lua_tonumber
(
L
,
-
1
));
}
lua_pop
(
L
,
1
);
if
(
strcmp
(
value
,
"-Infinity"
)
==
0
||
strcmp
(
value
,
"NaN"
)
==
0
||
strcmp
(
value
,
"Infinity"
)
==
0
)
{
...
...
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