From ae36ba5d33b1ce61fab33ffc310da6bba38ca316 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 28 Sep 2014 13:08:00 +0100 Subject: Compilation fix --- Tools/ProtoProxy/Connection.cpp | 3 +-- src/Protocol/ProtocolRecognizer.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp index c5916c1ca..eaf4fab02 100644 --- a/Tools/ProtoProxy/Connection.cpp +++ b/Tools/ProtoProxy/Connection.cpp @@ -1819,8 +1819,7 @@ bool cConnection::HandleServerKick(void) Reason.append(Split[4]); Reason.push_back(0); Reason.append(Split[5]); - AString ReasonBE16; - UTF8ToRawBEUTF16(Reason.data(), Reason.size(), ReasonBE16); + AString ReasonBE16 = UTF8ToRawBEUTF16(Reason.data(), Reason.size()); AString PacketStart("\xff"); PacketStart.push_back((ReasonBE16.size() / 2) / 256); PacketStart.push_back((ReasonBE16.size() / 2) % 256); diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp index 93d7cf0aa..ef6802d2b 100644 --- a/src/Protocol/ProtocolRecognizer.cpp +++ b/src/Protocol/ProtocolRecognizer.cpp @@ -200,7 +200,7 @@ void cProtocolRecognizer::SendDisconnect(const AString & a_Reason) static const int Packet = 0xff; // PACKET_DISCONNECT SendData((const char *)&Packet, 1); // WriteByte() - AString & UTF16 = UTF8ToRawBEUTF16(a_Reason.c_str(), a_Reason.length()); + AString UTF16 = UTF8ToRawBEUTF16(a_Reason.c_str(), a_Reason.length()); static const short Size = htons((short)(UTF16.size() / 2)); SendData((const char *)&Size, 2); // WriteShort() SendData(UTF16.data(), UTF16.size()); // WriteString() -- cgit v1.2.3