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:
Loic Blot 2017-05-18 20:55:27 +02:00
parent 9b5effffbb
commit 1c6d2f596d
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}