Fixed initialization of sockaddr_in.

This commit is contained in:
Patrick 2024-08-18 13:43:14 +02:00
parent 6d111904d4
commit d508ccfe2b

View File

@ -250,7 +250,7 @@ Task<StreamResult<std::unique_ptr<Socket>>> TCPServerSocket::c_waitForConnection
{ {
while (isListening()) while (isListening())
{ {
sockaddr_in client = {0}; sockaddr_in client = {};
socklen_t LENGTH = sizeof(sockaddr_in); socklen_t LENGTH = sizeof(sockaddr_in);
const int newSocket = accept(handle_, reinterpret_cast<sockaddr*>(&client), &LENGTH); const int newSocket = accept(handle_, reinterpret_cast<sockaddr*>(&client), &LENGTH);
if (newSocket < 0) if (newSocket < 0)