thanks to Matthias-Christian Ott for this hint

This commit is contained in:
Anselm R Garbe 2009-02-21 19:14:13 +00:00
parent ca6ba9a64a
commit b3ed5f414f

2
sic.c
View File

@ -188,7 +188,7 @@ main(int argc, char *argv[]) {
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
if(getaddrinfo(host, port, &hints, &res) != 0) if(getaddrinfo(host, port, &hints, &res) != 0)
die("error: cannot resolve hostname '%s'\n", host); die("error: cannot resolve hostname '%s'\n", host);
for(ri = res; r; r = r->ai_next) { for(r = res; r; r = r->ai_next) {
if((srv = socket(r->ai_family, r->ai_socktype, r->ai_protocol)) == -1) if((srv = socket(r->ai_family, r->ai_socktype, r->ai_protocol)) == -1)
continue; continue;
if(connect(srv, r->ai_addr, r->ai_addrlen) == 0) if(connect(srv, r->ai_addr, r->ai_addrlen) == 0)