Skip to content
Permalink
Browse files

Send max number of characters instead of asserting in case of too lon…

…g chat messages
  • Loading branch information...
sapier sapier
sapier authored and sapier committed May 11, 2014
1 parent 5c6cf63 commit 167df02e3d69dd0e8c8915944e6bab00417b15d5
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/client.cpp
@@ -2082,8 +2082,10 @@ void Client::sendChatMessage(const std::wstring &message)

// Write length
size_t messagesize = message.size();
assert(messagesize <= 0xFFFF);
writeU16(buf, (u16) (messagesize & 0xFFFF));
if (messagesize > 0xFFFF) {
messagesize = 0xFFFF;
}
writeU16(buf, (u16) messagesize);
os.write((char*)buf, 2);

// Write string

0 comments on commit 167df02

Please sign in to comment.
You can’t perform that action at this time.