From 699cef84b11d43ac23b6bc7b1b605aa8c53f35b6 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 8 Dec 2023 16:40:31 +0200 Subject: [server] Don't continue on accept() error --- server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/server.c b/server.c index 6862961..02c9f5a 100644 --- a/server.c +++ b/server.c @@ -112,6 +112,7 @@ int main(int argc, char* argv[]) { /* If so, accept the connection and pass execution to the "main" logic */ fd_client = accept(fd_socket, (struct sockaddr*)&sa_client, &sa_client_size); herrc(fd_client, "accept"); + if (fd_client < 0) continue; char* strAddr = inet_ntoa(sa_client.sin_addr); count++; -- cgit v1.2.3