Fix invalid cast fix resulting in chat messages beeing limited to 256 bytes
authorsapier <Sapier at GMX dot net>
Sun, 11 May 2014 13:32:15 +0000 (15:32 +0200)
committersapier <Sapier at GMX dot net>
Sun, 11 May 2014 13:32:15 +0000 (15:32 +0200)
src/client.cpp

index b0488500f99d223bf55a89fa8069a0c5ed86781b..871209a17089463ff5ffa9daf97b0cc5d7597ded 100644 (file)
@@ -2083,7 +2083,7 @@ void Client::sendChatMessage(const std::wstring &message)
        // Write length
        size_t messagesize = message.size();
        assert(messagesize <= 0xFFFF);
-       writeU16(buf, (u16) (messagesize & 0xFF));
+       writeU16(buf, (u16) (messagesize & 0xFFFF));
        os.write((char*)buf, 2);
        
        // Write string