summaryrefslogtreecommitdiff
path: root/src/net/messageout.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-08 22:47:17 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-08 22:47:17 +0300
commit3f9d0c023f3d84de0c68dbf9f7c29aa1b0abb9c9 (patch)
tree93589fc3f913324254ad543481691565e0baf67e /src/net/messageout.cpp
parent8daa939a45794c26a33e109c13c4d6f58a46e00e (diff)
downloadplus-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.cpp16
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: ***");