Fix setBuffer of the OutputMessage class
This commit is contained in:
parent
92532a958e
commit
1c8cea513c
|
@ -38,11 +38,11 @@ void OutputMessage::reset()
|
|||
void OutputMessage::setBuffer(const std::string& buffer)
|
||||
{
|
||||
int len = buffer.size();
|
||||
checkWrite(MAX_HEADER_SIZE + len);
|
||||
memcpy(m_buffer + MAX_HEADER_SIZE, buffer.c_str(), len);
|
||||
m_writePos = MAX_HEADER_SIZE;
|
||||
m_headerPos = MAX_HEADER_SIZE;
|
||||
m_messageSize = len;
|
||||
reset();
|
||||
checkWrite(len);
|
||||
memcpy((char*)(m_buffer + m_writePos), buffer.c_str(), len);
|
||||
m_writePos += len;
|
||||
m_messageSize += len;
|
||||
}
|
||||
|
||||
void OutputMessage::addU8(uint8 value)
|
||||
|
|
Loading…
Reference in New Issue