diff options
Diffstat (limited to 'irc.c')
-rw-r--r-- | irc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -6,6 +6,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include "irc.h" @@ -25,7 +26,7 @@ static int tcp_connect(const char *host, int port) addr.sin_family = AF_INET; addr.sin_port = htons(port); memcpy(&addr.sin_addr, h->h_addr, h->h_length); - if (connect(sock, (struct sockaddr *) &addr, + if (connect(sock, (struct sockaddr *) &addr, sizeof(struct sockaddr_in))) { close(sock); sock = -1; @@ -84,4 +85,5 @@ int irc_close(struct irc_session *s, const char *msg) close(s->fd); } free(s); + return 0; } |