diff options
author | Rob Landley <rob@landley.net> | 2012-03-21 17:49:14 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2012-03-21 17:49:14 -0500 |
commit | 66b0f99d0c0b1d9ad9dcee265081f884b3d949ce (patch) | |
tree | 7986ada6bfa20cc759cddbac228d2cd7dbd14b31 /toys/sleep.c | |
parent | f78c63a7035ceabb0dcb907cb5764b18da495f82 (diff) | |
download | toybox-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.c | 8 |
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)); |