mdev: fix a bug where we were eating argv[0] of helper
[oweals/busybox.git] / networking / udhcp / dumpleases.c
index fb50d6888697de2f71458369135af5a5a320780f..c98005f138cb2e9e55d40c4c2dd4f2797637e869 100644 (file)
@@ -2,13 +2,12 @@
 /*
  * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
  */
-#include <getopt.h>
 
 #include "common.h"
 #include "dhcpd.h"
 
-int dumpleases_main(int argc, char **argv);
-int dumpleases_main(int argc, char **argv)
+int dumpleases_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
+int dumpleases_main(int argc ATTRIBUTE_UNUSED, char **argv)
 {
        int fd;
        int i;
@@ -24,16 +23,16 @@ int dumpleases_main(int argc, char **argv)
                OPT_f   = 0x4,  // -f
        };
 #if ENABLE_GETOPT_LONG
-       static const char dumpleases_longopts[] =
+       static const char dumpleases_longopts[] ALIGN1 =
                "absolute\0"  No_argument       "a"
                "remaining\0" No_argument       "r"
                "file\0"      Required_argument "f"
-               "\0";
+               ;
 
        applet_long_options = dumpleases_longopts;
 #endif
        opt_complementary = "=0:a--r:r--a";
-       opt = getopt32(argc, argv, "arf:", &file);
+       opt = getopt32(argv, "arf:", &file);
 
        fd = xopen(file, O_RDONLY);