mirror of git://git.suckless.org/ubase
watch: If period is negative default to 0.1s
This commit is contained in:
parent
703e18185c
commit
cee1a0170d
2
watch.c
2
watch.c
|
@ -28,6 +28,8 @@ main(int argc, char *argv[])
|
||||||
period = strtof(EARGF(usage()), &end);
|
period = strtof(EARGF(usage()), &end);
|
||||||
if (*end != '\0' || errno != 0)
|
if (*end != '\0' || errno != 0)
|
||||||
eprintf("invalid interval\n");
|
eprintf("invalid interval\n");
|
||||||
|
if (period < 0)
|
||||||
|
period = 0.1f;
|
||||||
interval = period * 1E6;
|
interval = period * 1E6;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue