The readBuffer now checks if the whole packet has arrived before attempting to parse it.

This commit is contained in:
stiffly
2016-03-03 15:16:42 +01:00
parent ae3cab6cd1
commit a7bff92899
5 changed files with 21 additions and 5 deletions
+4 -2
View File
@@ -54,8 +54,10 @@ void Packet::WriteString(const std::string& str)
}
resizeData();
}
memcpy(m_Data + m_Offset, str.data(), sizeOfString * sizeof(char));
m_Offset += sizeOfString * sizeof(char);
memcpy(m_Data + m_Offset, str.data(), str.size() * sizeof(char));
m_Offset += str.size() * sizeof(char);
m_Data[m_Offset] = '\0';
m_Offset += 1;
}
void Packet::WriteData(char * data, int sizeOfData)