[hackers] [ubase] watch: If period is negative default to 0.1s || sin

From: <git_AT_suckless.org>
Date: Sun, 30 Nov 2014 15:08:47 +0100

commit cee1a0170d17f6f9bbddcaa97a30dd7fa4f0387f
Author: sin <sin_AT_2f30.org>
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
_AT_@ -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:
Received on Sun Nov 30 2014 - 15:08:47 CET

This archive was generated by hypermail 2.3.0 : Sun Nov 30 2014 - 15:12:11 CET