watch: If period is negative default to 0.1s

This commit is contained in:
sin 2014-11-30 14:08:20 +00:00
parent 703e18185c
commit cee1a0170d
1 changed files with 2 additions and 0 deletions

View File

@ -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: