summaryrefslogtreecommitdiff
path: root/libbb/getopt32.c
diff options
context:
space:
mode:
authorDenys Vlasenko2017-07-03 21:31:16 +0200
committerDenys Vlasenko2017-07-03 21:31:16 +0200
commitd4e4fdb5ce5ccc067b3d35d877f7a7d978869517 (patch)
treebac3e4a55fa72db0c67d377b90869b4d63e8c3c9 /libbb/getopt32.c
parent2e989ef232e35750df573898077dd356003705b2 (diff)
downloadbusybox-d4e4fdb5ce5ccc067b3d35d877f7a7d978869517.zip
busybox-d4e4fdb5ce5ccc067b3d35d877f7a7d978869517.tar.gz
fixes for bugs found by make_single_applets.sh
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/getopt32.c')
-rw-r--r--libbb/getopt32.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index b87b835..80f4cc0 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -379,9 +379,7 @@ getopt32(char **argv, const char *applet_opts, ...)
int spec_flgs = 0;
/* skip 0: some applets cheat: they do not actually HAVE argv[0] */
- argc = 1;
- while (argv[argc])
- argc++;
+ argc = 1 + string_array_len(argv + 1);
va_start(p, applet_opts);