Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tcp: fix error msg
  • Loading branch information
perexg committed Nov 28, 2014
1 parent cf82786 commit 2ae32e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tcp.c
Expand Up @@ -84,8 +84,9 @@ tcp_connect(const char *hostname, int port, const char *bindaddr,
ip.ss_family = ai->ai_family;
if (inet_pton(AF_INET, bindaddr, IP_IN_ADDR(ip)) <= 0 ||
bind(fd, (struct sockaddr *)&ip, IP_IN_ADDRLEN(ip)) < 0) {
snprintf(errbuf, errbufsize, "Cannot bind to IPv%s addr '%s'", bindaddr,
ai->ai_family == AF_INET6 ? "6" : "4");
snprintf(errbuf, errbufsize, "Cannot bind to IPv%s addr '%s'",
ai->ai_family == AF_INET6 ? "6" : "4",
bindaddr);
freeaddrinfo(ai);
return -1;
}
Expand Down

0 comments on commit 2ae32e6

Please sign in to comment.