summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/common/c_internal.cpp3
-rw-r--r--src/script/cpp_api/s_base.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/script/common/c_internal.cpp b/src/script/common/c_internal.cpp
index 9a24b0e78..be9691ef4 100644
--- a/src/script/common/c_internal.cpp
+++ b/src/script/common/c_internal.cpp
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "common/c_internal.h"
#include "debug.h"
#include "log.h"
+#include "porting.h"
#include "settings.h"
std::string script_get_backtrace(lua_State *L)
@@ -82,7 +83,7 @@ void script_error(lua_State *L, int pcall_result, const char *mod, const char *f
err_descr = "<no description>";
char buf[256];
- snprintf(buf, sizeof(buf), "%s error from mod '%s' in callback %s(): ",
+ porting::mt_snprintf(buf, sizeof(buf), "%s error from mod '%s' in callback %s(): ",
err_type, mod, fxn);
std::string err_msg(buf);
diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp
index 293c774b0..d98359d20 100644
--- a/src/script/cpp_api/s_base.cpp
+++ b/src/script/cpp_api/s_base.cpp
@@ -293,7 +293,7 @@ void ScriptApiBase::stackDump(std::ostream &o)
break;
case LUA_TNUMBER: /* numbers */ {
char buf[10];
- snprintf(buf, 10, "%lf", lua_tonumber(m_luastack, i));
+ porting::mt_snprintf(buf, sizeof(buf), "%lf", lua_tonumber(m_luastack, i));
o << buf;
break;
}