aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-09-30 17:10:46 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-09-30 17:10:58 +0200
commit9bc6a6bd7b0ddb12cbafdd6d3b70fb6b10c0d2ba (patch)
tree9b55587e612c57457d2875ddde1ab10b2e470c44 /src/protocol.cpp
parentef0801bd138101898f56c2348355cf7feee1fb0e (diff)
parent305087bdf640a5c0b3eeeb90d33ee255d2456eba (diff)
Merge #8822: net: Consistent checksum handling
305087b net: Hardcode protocol sizes and use fixed-size types (Wladimir J. van der Laan) 41e58fa net: Consistent checksum handling (Wladimir J. van der Laan)
Diffstat (limited to 'src/protocol.cpp')
-rw-r--r--src/protocol.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp
index 247c6c2120..54ad62b1a2 100644
--- a/src/protocol.cpp
+++ b/src/protocol.cpp
@@ -79,7 +79,7 @@ CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn)
memcpy(pchMessageStart, pchMessageStartIn, MESSAGE_START_SIZE);
memset(pchCommand, 0, sizeof(pchCommand));
nMessageSize = -1;
- nChecksum = 0;
+ memset(pchChecksum, 0, CHECKSUM_SIZE);
}
CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn)
@@ -88,7 +88,7 @@ CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn, const
memset(pchCommand, 0, sizeof(pchCommand));
strncpy(pchCommand, pszCommand, COMMAND_SIZE);
nMessageSize = nMessageSizeIn;
- nChecksum = 0;
+ memset(pchChecksum, 0, CHECKSUM_SIZE);
}
std::string CMessageHeader::GetCommand() const