summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inet')
-rw-r--r--libc/inet/hostid.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libc/inet/hostid.c b/libc/inet/hostid.c
index 4ddfbd123..5977ada25 100644
--- a/libc/inet/hostid.c
+++ b/libc/inet/hostid.c
@@ -61,8 +61,7 @@ long int gethostid(void)
* Mitch
*/
if (gethostname(host, HOST_NAME_MAX) >= 0 && *host) {
- struct addrinfo hints, *results, *addr;
- memset(&hints, 0, sizeof(struct addrinfo));
+ struct addrinfo hints = {.ai_family = AF_INET}, *results, *addr;
if (!getaddrinfo(host, NULL, &hints, &results)) {
for (addr = results; addr; addr = results->ai_next) {
/* Just so it doesn't look exactly like the