summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-08-21 19:17:45 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-21 19:17:45 +0200
commit440523b022070335714063cc4889292eaa3376c8 (patch)
tree9bc734cb35b3553da18f18e638cd90cb57e91832 /src/Protocol
parentStatSerializer: use std::move (diff)
downloadcuberite-440523b022070335714063cc4889292eaa3376c8.tar
cuberite-440523b022070335714063cc4889292eaa3376c8.tar.gz
cuberite-440523b022070335714063cc4889292eaa3376c8.tar.bz2
cuberite-440523b022070335714063cc4889292eaa3376c8.tar.lz
cuberite-440523b022070335714063cc4889292eaa3376c8.tar.xz
cuberite-440523b022070335714063cc4889292eaa3376c8.tar.zst
cuberite-440523b022070335714063cc4889292eaa3376c8.zip
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/Protocol_1_8.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 79fd00138..ee72e14fb 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -1743,7 +1743,7 @@ bool cProtocol_1_8_0::CompressPacket(const AString & a_Packet, AString & a_Compr
LengthHeaderBuffer.ReadAll(LengthData);
a_CompressedData.reserve(LengthData.size() + UncompressedSize);
- a_CompressedData.append(LengthData.data(), LengthData.size());
+ a_CompressedData.assign(LengthData.data(), LengthData.size());
a_CompressedData.append(a_Packet);
return true;
@@ -1794,8 +1794,8 @@ bool cProtocol_1_8_0::CompressPacket(const AString & a_Packet, AString & a_Compr
AString LengthData;
LengthHeaderBuffer.ReadAll(LengthData);
- a_CompressedData.reserve(LengthData.size() + DataSize);
- a_CompressedData.append(LengthData.data(), LengthData.size());
+ a_CompressedData.reserve(LengthData.size() + CompressedSize);
+ a_CompressedData.assign(LengthData.data(), LengthData.size());
a_CompressedData.append(CompressedData, CompressedSize);
return true;