From 66b0f99d0c0b1d9ad9dcee265081f884b3d949ce Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 21 Mar 2012 17:49:14 -0500 Subject: Test the right variable in NULL guard, and add NOP "s" suffix. --- toys/sleep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'toys') 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)); -- cgit v1.2.3