Merge pull request #2017 from def-/pr-fix-websockets-warning

Fix Websockets warning
This commit is contained in:
Dennis Felsing 2019-12-31 10:38:49 +01:00 committed by GitHub
commit 9816881a2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1646,9 +1646,10 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *buffer, int maxsize, MMSGS
if(bytes <= 0 && sock.web_ipv4sock >= 0)
{
socklen_t fromlen = sizeof(struct sockaddr);
bytes = websocket_recv(sock.web_ipv4sock, buffer, maxsize, (struct sockaddr_in *)&sockaddrbuf, fromlen);
struct sockaddr_in *sockaddrbuf_in = (struct sockaddr_in *)&sockaddrbuf;
bytes = websocket_recv(sock.web_ipv4sock, buffer, maxsize, sockaddrbuf_in, fromlen);
*data = buffer;
((struct sockaddr_in *)&sockaddrbuf)->sin_family = AF_WEBSOCKET_INET;
sockaddrbuf_in->sin_family = AF_WEBSOCKET_INET;
}
#endif