]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix segfault when passing options in.
authorRoy Marples <roy@marples.name>
Mon, 15 Sep 2008 16:43:57 +0000 (16:43 +0000)
committerRoy Marples <roy@marples.name>
Mon, 15 Sep 2008 16:43:57 +0000 (16:43 +0000)
dhcpcd.c

index 47ef462a372a7ba8aa7851b0f708ebd3edb25279..c313bc4088652920a267681631e41e41c1038a1e 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1016,9 +1016,7 @@ handle_args(int argc, char **argv)
                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) {