diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-06-19 09:03:43 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-06-19 09:10:45 +0200 |
commit | 4c772eac025459d848a753a5b7e78721ded80e81 (patch) | |
tree | 936dd52e8590c86e602f7cc6df21ec97269fc2be /irc.c | |
parent | f0984ed912b0343dd353a35de6d01768e021b217 (diff) | |
download | sircbot-4c772eac025459d848a753a5b7e78721ded80e81.tar.bz2 sircbot-4c772eac025459d848a753a5b7e78721ded80e81.tar.xz |
fix various compiler warnings
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; } |