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/ping6.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/ping6.c')
-rw-r--r-- | networking/ping6.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/networking/ping6.c b/networking/ping6.c index 6079c40d9..0d6a739bf 100644 --- a/networking/ping6.c +++ b/networking/ping6.c | |||
@@ -145,10 +145,10 @@ int ping6_main(int argc, char **argv) | |||
145 | /* full(er) version */ | 145 | /* full(er) version */ |
146 | static struct sockaddr_in6 pingaddr; | 146 | static struct sockaddr_in6 pingaddr; |
147 | static int pingsock = -1; | 147 | static int pingsock = -1; |
148 | static int datalen; /* intentionally uninitialized to work around gcc bug */ | 148 | static unsigned datalen; /* intentionally uninitialized to work around gcc bug */ |
149 | static int if_index; | 149 | static int if_index; |
150 | 150 | ||
151 | static long ntransmitted, nreceived, nrepeats, pingcount; | 151 | static unsigned long ntransmitted, nreceived, nrepeats, pingcount; |
152 | static int myid, options; | 152 | static int myid, options; |
153 | static unsigned long tmin = ULONG_MAX, tmax, tsum; | 153 | static unsigned long tmin = ULONG_MAX, tmax, tsum; |
154 | static char rcvd_tbl[MAX_DUP_CHK / 8]; | 154 | static char rcvd_tbl[MAX_DUP_CHK / 8]; |
@@ -168,12 +168,12 @@ static void pingstats(int junk) | |||
168 | signal(SIGINT, SIG_IGN); | 168 | signal(SIGINT, SIG_IGN); |
169 | 169 | ||
170 | printf("\n--- %s ping statistics ---\n", hostent->h_name); | 170 | printf("\n--- %s ping statistics ---\n", hostent->h_name); |
171 | printf("%ld packets transmitted, ", ntransmitted); | 171 | printf("%lu packets transmitted, ", ntransmitted); |
172 | printf("%ld packets received, ", nreceived); | 172 | printf("%lu packets received, ", nreceived); |
173 | if (nrepeats) | 173 | if (nrepeats) |
174 | printf("%ld duplicates, ", nrepeats); | 174 | printf("%lu duplicates, ", nrepeats); |
175 | if (ntransmitted) | 175 | if (ntransmitted) |
176 | printf("%ld%% packet loss\n", | 176 | printf("%lu%% packet loss\n", |
177 | (ntransmitted - nreceived) * 100 / ntransmitted); | 177 | (ntransmitted - nreceived) * 100 / ntransmitted); |
178 | if (nreceived) | 178 | if (nreceived) |
179 | printf("round-trip min/avg/max = %lu.%lu/%lu.%lu/%lu.%lu ms\n", | 179 | printf("round-trip min/avg/max = %lu.%lu/%lu.%lu/%lu.%lu ms\n", |
@@ -439,13 +439,13 @@ int ping6_main(int argc, char **argv) | |||
439 | if (--argc <= 0) | 439 | if (--argc <= 0) |
440 | bb_show_usage(); | 440 | bb_show_usage(); |
441 | argv++; | 441 | argv++; |
442 | pingcount = atoi(*argv); | 442 | pingcount = xatoul(*argv); |
443 | break; | 443 | break; |
444 | case 's': | 444 | case 's': |
445 | if (--argc <= 0) | 445 | if (--argc <= 0) |
446 | bb_show_usage(); | 446 | bb_show_usage(); |
447 | argv++; | 447 | argv++; |
448 | datalen = atoi(*argv); | 448 | datalen = xatou16(*argv); |
449 | break; | 449 | break; |
450 | case 'I': | 450 | case 'I': |
451 | if (--argc <= 0) | 451 | if (--argc <= 0) |