diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-08 22:47:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-08 22:47:17 +0300 |
commit | 3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9 (patch) | |
tree | 93589fc3f913324254ad543481691565e0baf67e /src/net/messageout.cpp | |
parent | 8daa939a45794c26a33e109c13c4d6f58a46e00e (diff) | |
download | plus-3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9.tar.gz plus-3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9.tar.bz2 plus-3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9.tar.xz plus-3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9.zip |
Fix code style in net.
Diffstat (limited to 'src/net/messageout.cpp')
-rw-r--r-- | src/net/messageout.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index aeb409f14..1b78e2aee 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -71,11 +71,15 @@ void MessageOut::writeString(const std::string &string, int length) expand(length); // Write the actual string - memcpy(mData + mPos, string.c_str(), stringLength); + memcpy(mData + static_cast<size_t>(mPos), string.c_str(), stringLength); // Pad remaining space with zeros if (length > stringLength) - memset(mData + mPos + stringLength, '\0', length - stringLength); + { + memset(mData + static_cast<size_t>(mPos + stringLength), + '\0', + length - stringLength); + } mPos += length; DEBUGLOG("writeString: " + string); @@ -99,11 +103,15 @@ void MessageOut::writeStringNoLog(const std::string &string, int length) expand(length); // Write the actual string - memcpy(mData + mPos, string.c_str(), stringLength); + memcpy(mData + static_cast<size_t>(mPos), string.c_str(), stringLength); // Pad remaining space with zeros if (length > stringLength) - memset(mData + mPos + stringLength, '\0', length - stringLength); + { + memset(mData + static_cast<size_t>(mPos + stringLength), + '\0', + length - stringLength); + } mPos += length; DEBUGLOG("writeString: ***"); |