Bux fixes

Fixed typo causing fr::Packet string extraction to fail.
Fixed Windows compilation error.
This commit is contained in:
Fred Nicolson 2017-01-22 14:20:24 +00:00
parent f8aa22d223
commit 6b2947932a
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@
#include <winsock2.h>
#include <windows.h>
#include <ws2tcpip.h>
#DEFINE SOL_TCP SOL_SOCKET
#define SOL_TCP SOL_SOCKET
#else
#define closesocket(x) close(x)
#define INVALID_SOCKET 0

View File

@ -330,11 +330,11 @@ namespace fr
*/
inline Packet&operator>>(std::string &var)
{
uint32_t length = (uint32_t)var.length();
uint32_t length;
*this >> length;
var = buffer.substr(buffer_offset, length);
buffer_offset += sizeof(length);
buffer_offset += length;
return *this;
}