From cee1a0170d17f6f9bbddcaa97a30dd7fa4f0387f Mon Sep 17 00:00:00 2001 From: sin Date: Sun, 30 Nov 2014 14:08:20 +0000 Subject: [PATCH] watch: If period is negative default to 0.1s --- watch.c | 2 ++ 1 file changed, 2 insertions(+) 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: