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