From: Denis Vlasenko Date: Wed, 20 Aug 2008 00:15:42 +0000 (-0000) Subject: libbb: getopt32() should not ever touch argv[0] (even read) X-Git-Tag: 1_12_0~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4301616b27afa808eeb8ea619dd7f3f9fa540462;p=oweals%2Fbusybox.git libbb: getopt32() should not ever touch argv[0] (even read) --- diff --git a/libbb/getopt32.c b/libbb/getopt32.c index 611333c66..54dc7857d 100644 --- a/libbb/getopt32.c +++ b/libbb/getopt32.c @@ -338,7 +338,8 @@ getopt32(char **argv, const char *applet_opts, ...) int spec_flgs = 0; - argc = 0; + /* skip 0: some applets cheat: they do not actually HAVE argv[0] */ + argc = 1; while (argv[argc]) argc++;