mirror of https://github.com/SeanOMik/libki.git
protocol: Fix problem with null characters in packet data
This commit is contained in:
parent
915b6e7e0a
commit
c618e7d536
|
@ -39,7 +39,7 @@ namespace protocol
|
||||||
static_assert(std::is_base_of<Serializable, DataT>::value,
|
static_assert(std::is_base_of<Serializable, DataT>::value,
|
||||||
"DataT must derive from Serializable.");
|
"DataT must derive from Serializable.");
|
||||||
|
|
||||||
std::istringstream iss(m_payload.data());
|
std::istringstream iss(std::string(m_payload.data(), m_payload.size()));
|
||||||
DataT *data = new DataT();
|
DataT *data = new DataT();
|
||||||
data->read_from(iss);
|
data->read_from(iss);
|
||||||
return data;
|
return data;
|
||||||
|
|
Loading…
Reference in New Issue