X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fteamspeak2.c;h=5d534603a69148f1441a12e0146cb1cb1933f1a9;hb=aa3811995bfae69f0d1a0f897acfa4a9a4c0138a;hp=89578f0e4642a61a4b3d1c11e0953c8015b37fe3;hpb=fe62d5e7df4374616d17246889d61a57ef46a1c4;p=collectd.git diff --git a/src/teamspeak2.c b/src/teamspeak2.c index 89578f0e..5d534603 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -198,7 +198,6 @@ static int tss2_get_socket (FILE **ret_read_fh, FILE **ret_write_fh) * Returns connected file objects or establishes the connection * if it's not already present */ - struct addrinfo ai_hints = { 0 }; struct addrinfo *ai_head; struct addrinfo *ai_ptr; int sd = -1; @@ -216,9 +215,11 @@ static int tss2_get_socket (FILE **ret_read_fh, FILE **ret_write_fh) } /* Get all addrs for this hostname */ - ai_hints.ai_flags = AI_ADDRCONFIG; - ai_hints.ai_family = AF_UNSPEC; - ai_hints.ai_socktype = SOCK_STREAM; + struct addrinfo ai_hints = { + .ai_family = AF_UNSPEC, + .ai_flags = AI_ADDRCONFIG, + .ai_socktype = SOCK_STREAM + }; status = getaddrinfo ((config_host != NULL) ? config_host : DEFAULT_HOST, (config_port != NULL) ? config_port : DEFAULT_PORT,