1
0

Compilation fix

This commit is contained in:
Tiger Wang 2014-09-28 13:08:00 +01:00
parent 1f8ee70d55
commit ae36ba5d33
2 changed files with 2 additions and 3 deletions

View File

@ -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);

View File

@ -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()