From: Florian Forster Date: Tue, 17 Feb 2009 13:56:22 +0000 (+0100) Subject: src/{lib,}oping.c: Fix a few problems -Wextra has found. X-Git-Tag: liboping-1.0.0^0 X-Git-Url: https://git.octo.it/?p=liboping.git;a=commitdiff_plain;h=b40c42896ca559087c19cbfd21ede27fe1eabaa7 src/{lib,}oping.c: Fix a few problems -Wextra has found. --- diff --git a/src/liboping.c b/src/liboping.c index e318145..c7bdaec 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -375,7 +375,7 @@ static pinghost_t *ping_receive_ipv6 (pinghost_t *ph, char *buffer, size_t buffe static int ping_receive_one (int fd, pinghost_t *ph, struct timeval *now) { char buffer[4096]; - size_t buffer_len; + ssize_t buffer_len; struct timeval diff; @@ -388,13 +388,13 @@ static int ping_receive_one (int fd, pinghost_t *ph, struct timeval *now) buffer_len = recvfrom (fd, buffer, sizeof (buffer), 0, (struct sockaddr *) &sa, &sa_len); - if (buffer_len == -1) + if (buffer_len < 0) { dprintf ("recvfrom: %s\n", strerror (errno)); return (-1); } - dprintf ("Read %zu bytes from fd = %i\n", buffer_len, fd); + dprintf ("Read %zi bytes from fd = %i\n", buffer_len, fd); if (sa.ss_family == AF_INET) { diff --git a/src/oping.c b/src/oping.c index 0c759c1..227b72c 100644 --- a/src/oping.c +++ b/src/oping.c @@ -77,6 +77,8 @@ static int opt_count = -1; void sigint_handler (int signal) { + /* Make compiler happy */ + signal = 0; /* Exit the loop */ opt_count = 0; }