summaryrefslogtreecommitdiff
path: root/src/net/messagein.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/messagein.cpp')
-rw-r--r--src/net/messagein.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp
index 8a51667db..6efc3ddfe 100644
--- a/src/net/messagein.cpp
+++ b/src/net/messagein.cpp
@@ -241,7 +241,7 @@ std::string MessageIn::readRawString(int length)
return str;
}
-char *MessageIn::readBytes(int length)
+unsigned char *MessageIn::readBytes(int length)
{
// Get string length
if (length < 0)
@@ -255,7 +255,7 @@ char *MessageIn::readBytes(int length)
return nullptr;
}
- char *buf = new char[length + 2];
+ unsigned char *buf = new unsigned char[length + 2];
memcpy (buf, mData + mPos, length);
buf[length] = 0;
@@ -265,7 +265,7 @@ char *MessageIn::readBytes(int length)
#ifdef ENABLEDEBUGLOG
std::string str;
for (int f = 0;f < length; f ++)
- str += strprintf ("%02x", buf[f]);
+ str += strprintf ("%02x", (unsigned)buf[f]);
str += " ";
for (int f = 0;f < length; f ++)
{