mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add a MSVC / Windows compatible snprintf function (#7353)
Use sizeof where applicable for mt_snprintf
This commit is contained in:
parent
9855651c06
commit
9537cfd3f8
13 changed files with 54 additions and 18 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue