Fixed read_raw buffer issues (properly this time).
Also added '<<' overload on Packet for char*
This commit is contained in:
parent
f74f1f1a94
commit
8a54e8994a
@ -187,6 +187,15 @@ namespace fr
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds a char array
|
||||
*/
|
||||
inline Packet &operator<<(const char *var)
|
||||
{
|
||||
*this << std::string(var);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*
|
||||
* Removes a string variable from the packet
|
||||
*/
|
||||
|
||||
@ -82,7 +82,8 @@ namespace fr
|
||||
while(bytes_remaining > 0)
|
||||
{
|
||||
size_t received = 0;
|
||||
Status status = receive_raw((uintptr_t*)dest + bytes_read, (size_t)bytes_remaining, received);
|
||||
char *arr = (char*)dest;
|
||||
Status status = receive_raw(&arr[bytes_read], (size_t)bytes_remaining, received);
|
||||
if(status != fr::Socket::Success)
|
||||
return status;
|
||||
bytes_remaining -= received;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user