summaryrefslogtreecommitdiffstats
path: root/plugins-root/check_icmp.c
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2014-12-02 10:36:25 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-12-02 10:36:25 (GMT)
commited9394880c18a66fa2b60483774cf49064dd3771 (patch)
tree3071a08327414c5f3004eb905b9e06110e230dc1 /plugins-root/check_icmp.c
parentff542df44c26170afbe63a1da712264c91114e0c (diff)
downloadmonitoring-plugins-ed9394880c18a66fa2b60483774cf49064dd3771.tar.gz
check_icmp: Cast size_t values for printf(3)
Convert size_t values to unsigned long for printf(3) in order to maximize portability.
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r--plugins-root/check_icmp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index 44c6826..3982def 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -786,7 +786,8 @@ wait_for_reply(int sock, u_int t)
786 memcpy(&data, icp.icmp_data, sizeof(data)); 786 memcpy(&data, icp.icmp_data, sizeof(data));
787 if (debug > 2) 787 if (debug > 2)
788 printf("ICMP echo-reply of len %lu, id %u, seq %u, cksum 0x%X\n", 788 printf("ICMP echo-reply of len %lu, id %u, seq %u, cksum 0x%X\n",
789 sizeof(data), ntohs(icp.icmp_id), ntohs(icp.icmp_seq), icp.icmp_cksum); 789 (unsigned long)sizeof(data), ntohs(icp.icmp_id),
790 ntohs(icp.icmp_seq), icp.icmp_cksum);
790 791
791 host = table[ntohs(icp.icmp_seq)/packets]; 792 host = table[ntohs(icp.icmp_seq)/packets];
792 tdiff = get_timevaldiff(&data.stime, &now); 793 tdiff = get_timevaldiff(&data.stime, &now);
@@ -865,7 +866,9 @@ send_icmp_ping(int sock, struct rta_host *host)
865 866
866 if (debug > 2) 867 if (debug > 2)
867 printf("Sending ICMP echo-request of len %lu, id %u, seq %u, cksum 0x%X to host %s\n", 868 printf("Sending ICMP echo-request of len %lu, id %u, seq %u, cksum 0x%X to host %s\n",
868 sizeof(data), ntohs(packet.icp->icmp_id), ntohs(packet.icp->icmp_seq), packet.icp->icmp_cksum, host->name); 869 (unsigned long)sizeof(data), ntohs(packet.icp->icmp_id),
870 ntohs(packet.icp->icmp_seq), packet.icp->icmp_cksum,
871 host->name);
869 872
870 memset(&iov, 0, sizeof(iov)); 873 memset(&iov, 0, sizeof(iov));
871 iov.iov_base = packet.buf; 874 iov.iov_base = packet.buf;