commit cee1a0170d17f6f9bbddcaa97a30dd7fa4f0387f Author: sin <[email protected]> Date: Sun Nov 30 14:08:20 2014 +0000
watch: If period is negative default to 0.1s
diff --git a/watch.c b/watch.c
index 1508883..51ac67f 100644
--- 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:
