From b40c42896ca559087c19cbfd21ede27fe1eabaa7 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 17 Feb 2009 14:56:22 +0100 Subject: [PATCH] src/{lib,}oping.c: Fix a few problems -Wextra has found. --- src/liboping.c | 6 +++--- src/oping.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) 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; } -- 2.11.0