From 9537cfd3f8264700619f58d15741829489e1099e Mon Sep 17 00:00:00 2001 From: nOOb3167 Date: Sun, 22 Jul 2018 21:56:06 +0200 Subject: Add a MSVC / Windows compatible snprintf function (#7353) Use sizeof where applicable for mt_snprintf --- src/script/common/c_internal.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/script/common') 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 = ""; 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); -- cgit v1.2.3