aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/test_connection.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/unittest/test_connection.cpp
parent9855651c06f84f29780cf6b25a392ac841b4630c (diff)
downloadminetest-9537cfd3f8264700619f58d15741829489e1099e.tar.xz
Add a MSVC / Windows compatible snprintf function (#7353)
Use sizeof where applicable for mt_snprintf
Diffstat (limited to 'src/unittest/test_connection.cpp')
-rw-r--r--src/unittest/test_connection.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/unittest/test_connection.cpp b/src/unittest/test_connection.cpp
index 8217c403e..c5e4085e1 100644
--- a/src/unittest/test_connection.cpp
+++ b/src/unittest/test_connection.cpp
@@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "test.h"
#include "log.h"
+#include "porting.h"
#include "settings.h"
#include "util/serialize.h"
#include "network/connection.h"
@@ -280,7 +281,7 @@ void TestConnection::testConnectSendReceive()
if (i % 2 == 0)
infostream << " ";
char buf[10];
- snprintf(buf, 10, "%.2X",
+ porting::mt_snprintf(buf, sizeof(buf), "%.2X",
((int)((const char *)pkt.getU8Ptr(0))[i]) & 0xff);
infostream<<buf;
}
@@ -323,7 +324,7 @@ void TestConnection::testConnectSendReceive()
if (i % 2 == 0)
infostream << " ";
char buf[10];
- snprintf(buf, 10, "%.2X", ((int)(recvdata[i])) & 0xff);
+ porting::mt_snprintf(buf, sizeof(buf), "%.2X", ((int)(recvdata[i])) & 0xff);
infostream << buf;
}
if (size > 20)