OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f78c63a
)
Test the right variable in NULL guard, and add NOP "s" suffix.
author
Rob Landley
<rob@landley.net>
Wed, 21 Mar 2012 22:49:14 +0000
(17:49 -0500)
committer
Rob Landley
<rob@landley.net>
Wed, 21 Mar 2012 22:49:14 +0000
(17:49 -0500)
toys/sleep.c
patch
|
blob
|
history
diff --git
a/toys/sleep.c
b/toys/sleep.c
index
311a268
..
ef6d827
100644
(file)
--- a/
toys/sleep.c
+++ b/
toys/sleep.c
@@
-39,10
+39,10
@@
void sleep_main(void)
// Parse suffix
if (*arg) {
- int i
mhd[]={
60,3600,86400};
- char *
mhd = "mhd", *c = strchr(
mhd, *arg);
- if (!
arg
) error_exit("Unknown suffix '%c'", *arg);
- d *= i
mhd[c-
mhd];
+ int i
smhd[]={1,
60,3600,86400};
+ char *
smhd = "smhd", *c = strchr(s
mhd, *arg);
+ if (!
c
) error_exit("Unknown suffix '%c'", *arg);
+ d *= i
smhd[c-s
mhd];
}
tv.tv_nsec=1000000000*(d-(tv.tv_sec = (unsigned long)d));