aboutsummaryrefslogtreecommitdiff
path: root/toys/sleep.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-03-21 17:49:14 -0500
committerRob Landley <rob@landley.net>2012-03-21 17:49:14 -0500
commit66b0f99d0c0b1d9ad9dcee265081f884b3d949ce (patch)
tree7986ada6bfa20cc759cddbac228d2cd7dbd14b31 /toys/sleep.c
parentf78c63a7035ceabb0dcb907cb5764b18da495f82 (diff)
downloadtoybox-66b0f99d0c0b1d9ad9dcee265081f884b3d949ce.tar.gz
Test the right variable in NULL guard, and add NOP "s" suffix.
Diffstat (limited to 'toys/sleep.c')
-rw-r--r--toys/sleep.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toys/sleep.c b/toys/sleep.c
index 311a2683..ef6d827b 100644
--- a/toys/sleep.c
+++ b/toys/sleep.c
@@ -39,10 +39,10 @@ void sleep_main(void)
// Parse suffix
if (*arg) {
- int imhd[]={60,3600,86400};
- char *mhd = "mhd", *c = strchr(mhd, *arg);
- if (!arg) error_exit("Unknown suffix '%c'", *arg);
- d *= imhd[c-mhd];
+ int ismhd[]={1,60,3600,86400};
+ char *smhd = "smhd", *c = strchr(smhd, *arg);
+ if (!c) error_exit("Unknown suffix '%c'", *arg);
+ d *= ismhd[c-smhd];
}
tv.tv_nsec=1000000000*(d-(tv.tv_sec = (unsigned long)d));