watch: If period is negative default to 0.1s - ubase - suckless linux base utils
(HTM) git clone git://git.suckless.org/ubase
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit cee1a0170d17f6f9bbddcaa97a30dd7fa4f0387f
(DIR) parent 703e18185c38b869d8f001241aa6b33c832ff5dc
(HTM) Author: sin <sin@2f30.org>
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(-)
---
(DIR) 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: