Skip to content

Commit

Permalink
Fix a warning pointed by GCC 7.1
Browse files Browse the repository at this point in the history
lua_tonumber overflow in snprintf (12 bytes and only 10 can be written)
  • Loading branch information
nerzhul committed May 18, 2017
1 parent 9b5efff commit 1c6d2f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/script/cpp_api/s_base.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1c6d2f5

Please sign in to comment.