mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue