mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
fix: remove the assert because buffer can be larger than UINT16_MAX.
This commit is contained in:
parent
452a02f729
commit
6b0d1151ac
|
@ -1 +1 @@
|
|||
261754f9fc58cd2d229488f00ea3503afbcc797cebcd10af1fad9e1adb3faf46 /usr/local/bin/tox-bootstrapd
|
||||
f80fc29c2a87f393fb84d56289ccfcc2e9860013627b20d76b6dfa56c8a8ffeb /usr/local/bin/tox-bootstrapd
|
||||
|
|
|
@ -1791,8 +1791,7 @@ Socket net_socket(const Network *ns, Family domain, int type, int protocol)
|
|||
uint16_t net_socket_data_recv_buffer(const Network *ns, Socket sock)
|
||||
{
|
||||
const int count = ns->funcs->recvbuf(ns->obj, sock.sock);
|
||||
assert(count >= 0 && count <= UINT16_MAX);
|
||||
return (uint16_t)count;
|
||||
return (uint16_t)max_s32(0, min_s32(count, UINT16_MAX));
|
||||
}
|
||||
|
||||
uint32_t net_htonl(uint32_t hostlong)
|
||||
|
|
Loading…
Reference in New Issue
Block a user