Mon, 21 Mar 2016 20:35:58 +0100
fixed hypthetical bug, where the client address is not correctly retrieved by accept()
src/network.c | file | annotate | diff | comparison | revisions | |
src/terminal-chess.h | file | annotate | diff | comparison | revisions |
--- a/src/network.c Fri Feb 26 11:55:42 2016 +0100 +++ b/src/network.c Mon Mar 21 20:35:58 2016 +0100 @@ -74,8 +74,9 @@ int net_listen(Server *server) { listen(server->fd, 1); - Client* client = calloc(1, sizeof(Client)); + Client* client = malloc(sizeof(Client)); client->fd = -1; + client->address_len = sizeof(client->address); server->client = client; client->fd = accept(server->fd,