aboutsummaryrefslogtreecommitdiff
path: root/coreutils/sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/sleep.c')
-rw-r--r--coreutils/sleep.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index 6890e35c1..78f9a8ebf 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -34,17 +34,16 @@ static const struct suffix_mult sfx[] = {
#endif
int sleep_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int sleep_main(int argc, char **argv)
+int sleep_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
unsigned duration;
-#if ENABLE_FEATURE_FANCY_SLEEP
-
- if (argc < 2) {
+ ++argv;
+ if (!*argv)
bb_show_usage();
- }
- ++argv;
+#if ENABLE_FEATURE_FANCY_SLEEP
+
duration = 0;
do {
duration += xatoul_range_sfx(*argv, 0, UINT_MAX-duration, sfx);
@@ -52,11 +51,7 @@ int sleep_main(int argc, char **argv)
#else /* FEATURE_FANCY_SLEEP */
- if (argc != 2) {
- bb_show_usage();
- }
-
- duration = xatou(argv[1]);
+ duration = xatou(*argv);
#endif /* FEATURE_FANCY_SLEEP */