diff --git a/endlessh.c b/endlessh.c index 3b07433..5cdcef3 100644 --- a/endlessh.c +++ b/endlessh.c @@ -425,8 +425,11 @@ server_create(int port) r = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &dummy, sizeof(dummy)); if (r == -1) die(); - struct sockaddr_in addr = {AF_INET, htons(port)}; - addr.sin_addr.s_addr = htonl(INADDR_ANY); + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_port = htons(port), + .sin_addr.s_addr = htonl(INADDR_ANY) + }; r = bind(s, (void *)&addr, sizeof(addr)); if (r == -1) die();