mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +01:00
Fix a warning pointed by GCC 7.1
lua_tonumber overflow in snprintf (12 bytes and only 10 can be written)
This commit is contained in:
parent
9b5effffbb
commit
1c6d2f596d
@ -240,7 +240,7 @@ void ScriptApiBase::stackDump(std::ostream &o)
|
||||
break;
|
||||
case LUA_TNUMBER: /* numbers */ {
|
||||
char buf[10];
|
||||
snprintf(buf, 10, "%g", lua_tonumber(m_luastack, i));
|
||||
snprintf(buf, 10, "%lf", lua_tonumber(m_luastack, i));
|
||||
o << buf;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user