From: Bill Blough Date: Wed, 21 Oct 2015 05:59:12 +0000 (-0400) Subject: Pass imcp unreachable message string to print_warning instead of int. X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eb955ee855c08e0085c158abea15cf7369ae802;p=fping.git Pass imcp unreachable message string to print_warning instead of int. This fixes the segfault reported in issue 85. --- diff --git a/src/fping.c b/src/fping.c index 47b6181..a7af5ed 100644 --- a/src/fping.c +++ b/src/fping.c @@ -1741,7 +1741,8 @@ int handle_random_icmp(FPING_ICMPHDR *p, struct sockaddr *addr, socklen_t addr_l addr_ascii, h->host ); } else { - print_warning("%s from %s for ICMP Echo sent to %s", icmp_code, addr_ascii, h->host); + print_warning("%s from %s for ICMP Echo sent to %s", + icmp_unreach_str[icmp_code], addr_ascii, h->host); } if( inet_addr( h->host ) == INADDR_NONE )