diff options
author | Denis Vlasenko | 2006-10-08 12:49:22 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-10-08 12:49:22 +0000 |
commit | 1385899416a4396385ad421ae1f532be7103738a (patch) | |
tree | fc4d14a910593d1235318bb36abe5e9f72d2039e /coreutils/sleep.c | |
parent | 5625415085e68ac5e150f54e685417c866620d76 (diff) | |
download | busybox-1385899416a4396385ad421ae1f532be7103738a.zip busybox-1385899416a4396385ad421ae1f532be7103738a.tar.gz |
attempt to regularize atoi mess.
Diffstat (limited to 'coreutils/sleep.c')
-rw-r--r-- | coreutils/sleep.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/coreutils/sleep.c b/coreutils/sleep.c index 3946c34..e32e215 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c @@ -24,7 +24,7 @@ #include "busybox.h" #ifdef CONFIG_FEATURE_FANCY_SLEEP -static const struct suffix_mult sleep_suffixes[] = { +static const struct suffix_mult sfx[] = { { "s", 1 }, { "m", 60 }, { "h", 60*60 }, @@ -46,9 +46,7 @@ int sleep_main(int argc, char **argv) ++argv; duration = 0; do { - duration += bb_xgetularg_bnd_sfx(*argv, 10, - 0, UINT_MAX-duration, - sleep_suffixes); + duration += xatoul_range_sfx(*argv, 0, UINT_MAX-duration, sfx); } while (*++argv); #else /* CONFIG_FEATURE_FANCY_SLEEP */ @@ -57,11 +55,7 @@ int sleep_main(int argc, char **argv) bb_show_usage(); } -#if UINT_MAX == ULONG_MAX - duration = bb_xgetularg10(argv[1]); -#else - duration = bb_xgetularg10_bnd(argv[1], 0, UINT_MAX); -#endif + duration = xatou(argv[1]); #endif /* CONFIG_FEATURE_FANCY_SLEEP */ |