watch: If period is negative default to 0.1s - ubase - suckless linux base utils | |
git clone git://git.suckless.org/ubase | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit cee1a0170d17f6f9bbddcaa97a30dd7fa4f0387f | |
parent 703e18185c38b869d8f001241aa6b33c832ff5dc | |
Author: sin <[email protected]> | |
Date: Sun, 30 Nov 2014 14:08:20 +0000 | |
watch: If period is negative default to 0.1s | |
Diffstat: | |
M watch.c | 2 ++ | |
1 file changed, 2 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/watch.c b/watch.c | |
@@ -28,6 +28,8 @@ main(int argc, char *argv[]) | |
period = strtof(EARGF(usage()), &end); | |
if (*end != '\0' || errno != 0) | |
eprintf("invalid interval\n"); | |
+ if (period < 0) | |
+ period = 0.1f; | |
interval = period * 1E6; | |
break; | |
default: |