From fe7cd642b0b732f5d41403c2f6983ad676b69dd9 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 18 Aug 2007 15:32:12 +0000 Subject: don't pass argc in getopt32, it's superfluous (add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes text data bss dec hex filename 773469 1058 11092 785619 bfcd3 busybox_old 772644 1058 11092 784794 bf99a busybox_unstripped --- loginutils/addgroup.c | 2 +- loginutils/adduser.c | 2 +- loginutils/chpasswd.c | 2 +- loginutils/cryptpw.c | 2 +- loginutils/getty.c | 2 +- loginutils/login.c | 2 +- loginutils/passwd.c | 2 +- loginutils/su.c | 2 +- loginutils/sulogin.c | 2 +- loginutils/vlock.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) (limited to 'loginutils') diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c index cf7cca907..b213074a6 100644 --- a/loginutils/addgroup.c +++ b/loginutils/addgroup.c @@ -139,7 +139,7 @@ int addgroup_main(int argc, char **argv) * addgroup user group * Check for min, max and missing args */ opt_complementary = "-1:?2"; - if (getopt32(argc, argv, "g:", &group)) { + if (getopt32(argv, "g:", &group)) { gid = xatoul_range(group, 0, ((unsigned long)(gid_t)ULONG_MAX) >> 1); } /* move past the commandline options */ diff --git a/loginutils/adduser.c b/loginutils/adduser.c index 79cd2f4f7..eee4a000d 100644 --- a/loginutils/adduser.c +++ b/loginutils/adduser.c @@ -182,7 +182,7 @@ int adduser_main(int argc, char **argv) /* exactly one non-option arg */ opt_complementary = "=1"; - getopt32(argc, argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup); + getopt32(argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup); argv += optind; /* create a passwd struct */ diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c index e2a717a02..61f9b896a 100644 --- a/loginutils/chpasswd.c +++ b/loginutils/chpasswd.c @@ -33,7 +33,7 @@ int chpasswd_main(int argc, char **argv) opt_complementary = "m--e:e--m"; USE_GETOPT_LONG(applet_long_options = chpasswd_longopts;) - opt = getopt32(argc, argv, "em"); + opt = getopt32(argv, "em"); while ((name = xmalloc_getline(stdin)) != NULL) { pass = strchr(name, ':'); diff --git a/loginutils/cryptpw.c b/loginutils/cryptpw.c index 1c3059198..0847857de 100644 --- a/loginutils/cryptpw.c +++ b/loginutils/cryptpw.c @@ -12,7 +12,7 @@ int cryptpw_main(int argc, char **argv) { char salt[sizeof("$N$XXXXXXXX")]; - if (!getopt32(argc, argv, "a:", NULL) || argv[optind - 1][0] != 'd') { + if (!getopt32(argv, "a:", NULL) || argv[optind - 1][0] != 'd') { strcpy(salt, "$1$"); /* Too ugly, and needs even more magic to handle endianness: */ //((uint32_t*)&salt)[0] = '$' + '1'*0x100 + '$'*0x10000; diff --git a/loginutils/getty.c b/loginutils/getty.c index 8b78856a2..0c000666e 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c @@ -180,7 +180,7 @@ static void parse_args(int argc, char **argv, struct options *op) { char *ts; - op->flags = getopt32(argc, argv, opt_string, + op->flags = getopt32(argv, opt_string, &(op->initstring), &fakehost, &(op->issue), &(op->login), &ts); if (op->flags & F_INITSTRING) { diff --git a/loginutils/login.c b/loginutils/login.c index d69e3ce51..7b60fd017 100644 --- a/loginutils/login.c +++ b/loginutils/login.c @@ -239,7 +239,7 @@ int login_main(int argc, char **argv) * (The name of the function is misleading. Not daemonizing here.) */ bb_daemonize_or_rexec(DAEMON_ONLY_SANITIZE | DAEMON_CLOSE_EXTRA_FDS, NULL); - opt = getopt32(argc, argv, "f:h:p", &opt_user, &opt_host); + opt = getopt32(argv, "f:h:p", &opt_user, &opt_host); if (opt & LOGIN_OPT_f) { if (!amroot) bb_error_msg_and_die("-f is for root only"); diff --git a/loginutils/passwd.c b/loginutils/passwd.c index 4f7094aec..ce333b49e 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c @@ -103,7 +103,7 @@ int passwd_main(int argc, char **argv) logmode = LOGMODE_BOTH; openlog(applet_name, LOG_NOWAIT, LOG_AUTH); - opt = getopt32(argc, argv, "a:lud", &opt_a); + opt = getopt32(argv, "a:lud", &opt_a); //argc -= optind; argv += optind; diff --git a/loginutils/su.c b/loginutils/su.c index fd17319da..b4681fb6a 100644 --- a/loginutils/su.c +++ b/loginutils/su.c @@ -23,7 +23,7 @@ int su_main(int argc, char **argv) const char *tty; char *old_user; - flags = getopt32(argc, argv, "mplc:s:", &opt_command, &opt_shell); + flags = getopt32(argv, "mplc:s:", &opt_command, &opt_shell); argc -= optind; argv += optind; diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c index 5638c4bc9..5f0a4081d 100644 --- a/loginutils/sulogin.c +++ b/loginutils/sulogin.c @@ -53,7 +53,7 @@ int sulogin_main(int argc, char **argv) logmode = LOGMODE_BOTH; openlog(applet_name, 0, LOG_AUTH); - if (getopt32(argc, argv, "t:", &timeout_arg)) { + if (getopt32(argv, "t:", &timeout_arg)) { timeout = xatoi_u(timeout_arg); } diff --git a/loginutils/vlock.c b/loginutils/vlock.c index 665ebd83a..d18a9f272 100644 --- a/loginutils/vlock.c +++ b/loginutils/vlock.c @@ -58,7 +58,7 @@ int vlock_main(int argc, char **argv) bb_show_usage(); } - o_lock_all = getopt32(argc, argv, "a"); + o_lock_all = getopt32(argv, "a"); vfd = xopen(CURRENT_TTY, O_RDWR); -- cgit v1.2.3