changeset 984:bdfda4828382 draft

Fix segfault when passing options in.
author Roy Marples <roy@marples.name>
date Mon, 15 Sep 2008 16:43:57 +0000
parents 1f2ad84ae760
children 7ab7d601d056
files dhcpcd.c
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dhcpcd.c	Mon Sep 15 16:43:27 2008 +0000
+++ b/dhcpcd.c	Mon Sep 15 16:43:57 2008 +0000
@@ -1016,9 +1016,7 @@
 		return 0;
 	}
 
-	if ((ifs = discover_interfaces(argc, argv))) {
-		argc += optind;
-		argv -= optind;
+	if ((ifs = discover_interfaces(argc - optind, argv + optind))) {
 		for (ifp = ifs; ifp; ifp = ifp->next) {
 			ifl = NULL;
 			for (ifn = ifaces; ifn; ifn = ifn->next) {