mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02: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:
@@ -240,7 +240,7 @@ void ScriptApiBase::stackDump(std::ostream &o)
|
|||||||
break;
|
break;
|
||||||
case LUA_TNUMBER: /* numbers */ {
|
case LUA_TNUMBER: /* numbers */ {
|
||||||
char buf[10];
|
char buf[10];
|
||||||
snprintf(buf, 10, "%g", lua_tonumber(m_luastack, i));
|
snprintf(buf, 10, "%lf", lua_tonumber(m_luastack, i));
|
||||||
o << buf;
|
o << buf;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user