diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-08 12:49:22 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-08 12:49:22 +0000 |
commit | 1385899416a4396385ad421ae1f532be7103738a (patch) | |
tree | fc4d14a910593d1235318bb36abe5e9f72d2039e /networking/ping.c | |
parent | 5625415085e68ac5e150f54e685417c866620d76 (diff) | |
download | busybox-w32-1385899416a4396385ad421ae1f532be7103738a.tar.gz busybox-w32-1385899416a4396385ad421ae1f532be7103738a.tar.bz2 busybox-w32-1385899416a4396385ad421ae1f532be7103738a.zip |
attempt to regularize atoi mess.
Diffstat (limited to 'networking/ping.c')
-rw-r--r-- | networking/ping.c | 16 |
1 files changed, 8 insertions, 8 deletions
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) | |||
157 | static struct sockaddr_in pingaddr; | 157 | static struct sockaddr_in pingaddr; |
158 | static struct sockaddr_in sourceaddr; | 158 | static struct sockaddr_in sourceaddr; |
159 | static int pingsock = -1; | 159 | static int pingsock = -1; |
160 | static int datalen; /* intentionally uninitialized to work around gcc bug */ | 160 | static unsigned datalen; /* intentionally uninitialized to work around gcc bug */ |
161 | 161 | ||
162 | static long ntransmitted, nreceived, nrepeats, pingcount; | 162 | static unsigned long ntransmitted, nreceived, nrepeats, pingcount; |
163 | static int myid, options; | 163 | static int myid, options; |
164 | static unsigned long tmin = ULONG_MAX, tmax, tsum; | 164 | static unsigned long tmin = ULONG_MAX, tmax, tsum; |
165 | static char rcvd_tbl[MAX_DUP_CHK / 8]; | 165 | static char rcvd_tbl[MAX_DUP_CHK / 8]; |
@@ -179,12 +179,12 @@ static void pingstats(int junk) | |||
179 | signal(SIGINT, SIG_IGN); | 179 | signal(SIGINT, SIG_IGN); |
180 | 180 | ||
181 | printf("\n--- %s ping statistics ---\n", hostent->h_name); | 181 | printf("\n--- %s ping statistics ---\n", hostent->h_name); |
182 | printf("%ld packets transmitted, ", ntransmitted); | 182 | printf("%lu packets transmitted, ", ntransmitted); |
183 | printf("%ld packets received, ", nreceived); | 183 | printf("%lu packets received, ", nreceived); |
184 | if (nrepeats) | 184 | if (nrepeats) |
185 | printf("%ld duplicates, ", nrepeats); | 185 | printf("%lu duplicates, ", nrepeats); |
186 | if (ntransmitted) | 186 | if (ntransmitted) |
187 | printf("%ld%% packet loss\n", | 187 | printf("%lu%% packet loss\n", |
188 | (ntransmitted - nreceived) * 100 / ntransmitted); | 188 | (ntransmitted - nreceived) * 100 / ntransmitted); |
189 | if (nreceived) | 189 | if (nreceived) |
190 | printf("round-trip min/avg/max = %lu.%lu/%lu.%lu/%lu.%lu ms\n", | 190 | 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) | |||
427 | if (--argc <= 0) | 427 | if (--argc <= 0) |
428 | bb_show_usage(); | 428 | bb_show_usage(); |
429 | argv++; | 429 | argv++; |
430 | pingcount = atoi(*argv); | 430 | pingcount = xatoul(*argv); |
431 | break; | 431 | break; |
432 | case 's': | 432 | case 's': |
433 | if (--argc <= 0) | 433 | if (--argc <= 0) |
434 | bb_show_usage(); | 434 | bb_show_usage(); |
435 | argv++; | 435 | argv++; |
436 | datalen = atoi(*argv); | 436 | datalen = xatou16(*argv); |
437 | break; | 437 | break; |
438 | case 'I': | 438 | case 'I': |
439 | if (--argc <= 0) | 439 | if (--argc <= 0) |