Mercurial > hg > toybox
changeset 555:2871a78416a6
Test the right variable in NULL guard, and add NOP "s" suffix.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 21 Mar 2012 17:49:14 -0500 |
parents | 997e016fbdf0 |
children | 56a53ff54096 |
files | toys/sleep.c |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/toys/sleep.c Tue Mar 20 11:10:54 2012 -0500 +++ b/toys/sleep.c Wed Mar 21 17:49:14 2012 -0500 @@ -39,10 +39,10 @@ // 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));