diff options
author | Can Erkin Acar <canacar@cvs.openbsd.org> | 2008-07-31 04:24:12 +0000 |
---|---|---|
committer | Can Erkin Acar <canacar@cvs.openbsd.org> | 2008-07-31 04:24:12 +0000 |
commit | 66fcf664ebd6aebba255088779f0b526fbc860ad (patch) | |
tree | 283851b5756e4ba32028d186fdb3555ee54aaefd /usr.bin | |
parent | cae9d2980c9b264c01eabbe0ae68a26cfc60555a (diff) |
Do not allow negative or zero delay values from the command line,
use the same check as the -s option. Noticed by johan@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/systat/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 7be6527f314..28ebe0de07d 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.41 2008/07/12 06:20:47 canacar Exp $ */ +/* $Id: main.c,v 1.42 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); |