diff options
Diffstat (limited to 'networking/arping.c')
-rw-r--r-- | networking/arping.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/arping.c b/networking/arping.c index 1ff6f90be..b9605985c 100644 --- a/networking/arping.c +++ b/networking/arping.c | |||
@@ -41,8 +41,8 @@ enum cfg_e { | |||
41 | static int cfg; | 41 | static int cfg; |
42 | 42 | ||
43 | static int s; | 43 | static int s; |
44 | static int count = -1; | 44 | static unsigned count = UINT_MAX; |
45 | static int timeout; | 45 | static unsigned timeout; |
46 | static int sent; | 46 | static int sent; |
47 | static int brd_sent; | 47 | static int brd_sent; |
48 | static int received; | 48 | static int received; |
@@ -276,9 +276,9 @@ int arping_main(int argc, char **argv) | |||
276 | &_count, &_timeout, &device, &source); | 276 | &_count, &_timeout, &device, &source); |
277 | cfg |= opt & 0x3f; /* set respective flags */ | 277 | cfg |= opt & 0x3f; /* set respective flags */ |
278 | if (opt & 0x40) /* -c: count */ | 278 | if (opt & 0x40) /* -c: count */ |
279 | count = atoi(_count); | 279 | count = xatou(_count); |
280 | if (opt & 0x80) /* -w: timeout */ | 280 | if (opt & 0x80) /* -w: timeout */ |
281 | timeout = atoi(_timeout); | 281 | timeout = xatoul_range(_timeout, 0, INT_MAX/2000); |
282 | if (opt & 0x100) { /* -i: interface */ | 282 | if (opt & 0x100) { /* -i: interface */ |
283 | if (strlen(device) > IF_NAMESIZE) { | 283 | if (strlen(device) > IF_NAMESIZE) { |
284 | bb_error_msg_and_die("interface name '%s' is too long", | 284 | bb_error_msg_and_die("interface name '%s' is too long", |