aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2017-05-18 20:55:27 +0200
committerLoic Blot <loic.blot@unix-experience.fr>2017-05-18 20:55:27 +0200
commit1c6d2f596df8fc2254916cf323bdbaf13905aebf (patch)
treef67d89f3a2785250aa0530a32ab9009c0df2b537 /src/script/cpp_api
parent9b5effffbb0599f85014b53c3fd025b6a8222e02 (diff)
downloadminetest-1c6d2f596df8fc2254916cf323bdbaf13905aebf.tar.gz
minetest-1c6d2f596df8fc2254916cf323bdbaf13905aebf.tar.bz2
minetest-1c6d2f596df8fc2254916cf323bdbaf13905aebf.zip
Fix a warning pointed by GCC 7.1
lua_tonumber overflow in snprintf (12 bytes and only 10 can be written)
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r--src/script/cpp_api/s_base.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp
index e72af22c6..4d7461c5b 100644
--- a/src/script/cpp_api/s_base.cpp
+++ b/src/script/cpp_api/s_base.cpp
@@ -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;
}