From 87c7985f57f39ae3881695f2fc5b7079ab63c6b0 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ritschard Date: Mon, 12 May 2008 19:15:03 +0000 Subject: 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@ --- usr.sbin/ripd/ripd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.sbin/ripd/ripd.c') diff --git a/usr.sbin/ripd/ripd.c b/usr.sbin/ripd/ripd.c index 5c91167ce68..cdba3cca94a 100644 --- a/usr.sbin/ripd/ripd.c +++ b/usr.sbin/ripd/ripd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ripd.c,v 1.8 2007/10/24 20:23:09 claudio Exp $ */ +/* $OpenBSD: ripd.c,v 1.9 2008/05/12 19:15:02 pyr Exp $ */ /* * Copyright (c) 2006 Michele Marchetto @@ -158,6 +158,11 @@ main(int argc, char *argv[]) } } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); + mib[0] = CTL_NET; mib[1] = PF_INET; mib[2] = IPPROTO_IP; -- cgit v1.2.3