From 1385899416a4396385ad421ae1f532be7103738a Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 8 Oct 2006 12:49:22 +0000 Subject: attempt to regularize atoi mess. --- networking/ping.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'networking/ping.c') diff --git a/networking/ping.c b/networking/ping.c index a81472f96..8ca8be9b9 100644 --- a/networking/ping.c +++ b/networking/ping.c @@ -157,9 +157,9 @@ int ping_main(int argc, char **argv) static struct sockaddr_in pingaddr; static struct sockaddr_in sourceaddr; static int pingsock = -1; -static int datalen; /* intentionally uninitialized to work around gcc bug */ +static unsigned datalen; /* intentionally uninitialized to work around gcc bug */ -static long ntransmitted, nreceived, nrepeats, pingcount; +static unsigned long ntransmitted, nreceived, nrepeats, pingcount; static int myid, options; static unsigned long tmin = ULONG_MAX, tmax, tsum; static char rcvd_tbl[MAX_DUP_CHK / 8]; @@ -179,12 +179,12 @@ static void pingstats(int junk) signal(SIGINT, SIG_IGN); printf("\n--- %s ping statistics ---\n", hostent->h_name); - printf("%ld packets transmitted, ", ntransmitted); - printf("%ld packets received, ", nreceived); + printf("%lu packets transmitted, ", ntransmitted); + printf("%lu packets received, ", nreceived); if (nrepeats) - printf("%ld duplicates, ", nrepeats); + printf("%lu duplicates, ", nrepeats); if (ntransmitted) - printf("%ld%% packet loss\n", + printf("%lu%% packet loss\n", (ntransmitted - nreceived) * 100 / ntransmitted); if (nreceived) printf("round-trip min/avg/max = %lu.%lu/%lu.%lu/%lu.%lu ms\n", @@ -427,13 +427,13 @@ int ping_main(int argc, char **argv) if (--argc <= 0) bb_show_usage(); argv++; - pingcount = atoi(*argv); + pingcount = xatoul(*argv); break; case 's': if (--argc <= 0) bb_show_usage(); argv++; - datalen = atoi(*argv); + datalen = xatou16(*argv); break; case 'I': if (--argc <= 0) -- cgit v1.2.3