artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
203840b
)
Do not allow negative or zero delay values from the command line,
author
canacar
<canacar@openbsd.org>
Thu, 31 Jul 2008 04:24:11 +0000
(
04:24
+0000)
committer
canacar
<canacar@openbsd.org>
Thu, 31 Jul 2008 04:24:11 +0000
(
04:24
+0000)
use the same check as the -s option. Noticed by johan@
usr.bin/systat/main.c
patch
|
blob
|
history
diff --git
a/usr.bin/systat/main.c
b/usr.bin/systat/main.c
index
7be6527
..
28ebe0d
100644
(file)
--- a/
usr.bin/systat/main.c
+++ b/
usr.bin/systat/main.c
@@
-1,4
+1,4
@@
-/* $Id: main.c,v 1.4
1 2008/07/12 06:20:47
canacar Exp $ */
+/* $Id: main.c,v 1.4
2 2008/07/31 04:24:11
canacar Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@
-473,6
+473,8
@@
main(int argc, char *argv[])
} else if (argc == 2) {
viewstr = argv[0];
delay = atof(argv[1]);
+ if (delay <= 0)
+ delay = 5;
}
udelay = (useconds_t)(delay * 1000000.0);