1
0
Fork 0
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:
nOOb3167 2018-07-22 21:56:06 +02:00 committed by SmallJoker
parent 9855651c06
commit 9537cfd3f8
13 changed files with 54 additions and 18 deletions

View file

@ -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<<" ";