From fc20c767d4fdaa3bef6a693f2a309077f64a5b22 Mon Sep 17 00:00:00 2001 From: canacar Date: Thu, 31 Jul 2008 04:24:11 +0000 Subject: [PATCH] Do not allow negative or zero delay values from the command line, use the same check as the -s option. Noticed by johan@ --- usr.bin/systat/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.20.1