summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/net/messagein.cpp6
-rw-r--r--src/net/messagein.h2
2 files changed, 4 insertions, 4 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 ++)
{
diff --git a/src/net/messagein.h b/src/net/messagein.h
index 8dd43a1a0..1eb5bf232 100644
--- a/src/net/messagein.h
+++ b/src/net/messagein.h
@@ -95,7 +95,7 @@ class MessageIn
virtual std::string readRawString(int length);
- char *readBytes(int length);
+ unsigned char *readBytes(int length);
virtual ~MessageIn()
{ }