diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2008-05-12 19:15:03 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2008-05-12 19:15:03 +0000 |
commit | 87c7985f57f39ae3881695f2fc5b7079ab63c6b0 (patch) | |
tree | 3690460aeda8b64e13fee3f2d75588071eaf260e /usr.sbin/watchdogd | |
parent | 970ec1da0136707fa8b46e7b91d99c0d75e50d29 (diff) |
Error out with usage line if additional arguments are given after the
option parsing. Found out the hard way by jdixon on ifstated.
ok sobrado@, jdixon@, millert@
Diffstat (limited to 'usr.sbin/watchdogd')
-rw-r--r-- | usr.sbin/watchdogd/watchdogd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/watchdogd/watchdogd.c b/usr.sbin/watchdogd/watchdogd.c index 02549b89fdf..48457ce0d01 100644 --- a/usr.sbin/watchdogd/watchdogd.c +++ b/usr.sbin/watchdogd/watchdogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: watchdogd.c,v 1.11 2007/01/02 22:46:37 mbalmer Exp $ */ +/* $OpenBSD: watchdogd.c,v 1.12 2008/05/12 19:15:02 pyr Exp $ */ /* * Copyright (c) 2005 Marc Balmer <mbalmer@openbsd.org> @@ -86,6 +86,11 @@ main(int argc, char *argv[]) } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); + if (interval == 0 && (interval = period / 3) == 0) interval = 1; |