diff --git a/src/SFML/Network/Packet.cpp b/src/SFML/Network/Packet.cpp index 4fafb4cf..965685c7 100644 --- a/src/SFML/Network/Packet.cpp +++ b/src/SFML/Network/Packet.cpp @@ -247,7 +247,7 @@ Packet& Packet::operator >>(float& data) { if (checkSize(sizeof(data))) { - data = *reinterpret_cast(&m_data[m_readPos]); + std::memcpy(&data, &m_data[m_readPos], sizeof(data)); m_readPos += sizeof(data); } @@ -260,7 +260,7 @@ Packet& Packet::operator >>(double& data) { if (checkSize(sizeof(data))) { - data = *reinterpret_cast(&m_data[m_readPos]); + std::memcpy(&data, &m_data[m_readPos], sizeof(data)); m_readPos += sizeof(data); }