summaryrefslogtreecommitdiff
path: root/src/serverenvironment.cpp
diff options
context:
space:
mode:
authornOOb3167 <nOOb3167@gmail.com>2018-07-22 21:56:06 +0200
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-07-22 21:56:06 +0200
commit9537cfd3f8264700619f58d15741829489e1099e (patch)
tree36412677aba19e1a2037db7fad2f934a2daa5046 /src/serverenvironment.cpp
parent9855651c06f84f29780cf6b25a392ac841b4630c (diff)
downloadminetest-9537cfd3f8264700619f58d15741829489e1099e.tar.gz
minetest-9537cfd3f8264700619f58d15741829489e1099e.tar.bz2
minetest-9537cfd3f8264700619f58d15741829489e1099e.zip
Add a MSVC / Windows compatible snprintf function (#7353)
Use sizeof where applicable for mt_snprintf
Diffstat (limited to 'src/serverenvironment.cpp')
-rw-r--r--src/serverenvironment.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/serverenvironment.cpp b/src/serverenvironment.cpp
index 08870589e..7d7eb4c08 100644
--- a/src/serverenvironment.cpp
+++ b/src/serverenvironment.cpp
@@ -26,6 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "nodemetadata.h"
#include "gamedef.h"
#include "map.h"
+#include "porting.h"
#include "profiler.h"
#include "raycast.h"
#include "remoteplayer.h"
@@ -1860,9 +1861,9 @@ static void print_hexdump(std::ostream &o, const std::string &data)
int i = i0 + di;
char buf[4];
if(di<thislinelength)
- snprintf(buf, 4, "%.2x ", data[i]);
+ porting::mt_snprintf(buf, sizeof(buf), "%.2x ", data[i]);
else
- snprintf(buf, 4, " ");
+ porting::mt_snprintf(buf, sizeof(buf), " ");
o<<buf;
}
o<<" ";