]> git.meshlink.io Git - meshlink/blobdiff - src/net_setup.c
Fix all compiler warnings found using -Wall -W -pedantic.
[meshlink] / src / net_setup.c
index 2cd021111a204aebb37b4e0273a12ec75e19beed..f2621f3b92e6f87c0f2afcbcbf742b4ba22f7aa6 100644 (file)
@@ -273,15 +273,13 @@ static bool add_listen_address(meshlink_handle_t *mesh, char *address, bool bind
                }
        }
 
-       struct addrinfo *ai, hint = {};
-
-       hint.ai_family = addressfamily;
-
-       hint.ai_socktype = SOCK_STREAM;
-
-       hint.ai_protocol = IPPROTO_TCP;
-
-       hint.ai_flags = AI_PASSIVE;
+       struct addrinfo *ai;
+       struct addrinfo hint = {
+               .ai_family = addressfamily,
+               .ai_socktype = SOCK_STREAM,
+               .ai_protocol = IPPROTO_TCP,
+               .ai_flags = AI_PASSIVE,
+       };
 
        int err = getaddrinfo(address && *address ? address : NULL, port, &hint, &ai);