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
This commit is contained in:
Denis Vlasenko
2007-08-18 15:32:12 +00:00
parent d6cd9d7fe9
commit fe7cd642b0
143 changed files with 174 additions and 169 deletions

View File

@ -16,7 +16,7 @@ int dmesg_main(int argc, char **argv);
int dmesg_main(int argc, char **argv)
{
char *size, *level;
int flags = getopt32(argc, argv, "cs:n:", &size, &level);
int flags = getopt32(argv, "cs:n:", &size, &level);
if (flags & 4) {
if (klogctl(8, NULL, xatoul_range(level, 0, 10)))

View File

@ -57,7 +57,7 @@ int fdformat_main(int argc,char **argv)
if (argc < 2) {
bb_show_usage();
}
verify = !getopt32(argc, argv, "n");
verify = !getopt32(argv, "n");
argv += optind;
xstat(*argv, &st);

View File

@ -2752,7 +2752,7 @@ int fdisk_main(int argc, char **argv)
PTR_TO_GLOBALS = xzalloc(sizeof(G));
opt = getopt32(argc, argv, "b:C:H:lS:u" USE_FEATURE_FDISK_BLKSIZE("s"),
opt = getopt32(argv, "b:C:H:lS:u" USE_FEATURE_FDISK_BLKSIZE("s"),
&str_b, &str_C, &str_H, &str_S);
argc -= optind;
argv += optind;

View File

@ -314,11 +314,11 @@ int getopt_main(int argc, char *argv[])
}
#if !ENABLE_GETOPT_LONG
opt = getopt32(argc, argv, "+o:n:qQs:Tu", &optstr, &name, &s_arg);
opt = getopt32(argv, "+o:n:qQs:Tu", &optstr, &name, &s_arg);
#else
applet_long_options = getopt_longopts;
opt_complementary = "l::";
opt = getopt32(argc, argv, "+o:n:qQs:Tual:",
opt = getopt32(argv, "+o:n:qQs:Tual:",
&optstr, &name, &s_arg, &l_arg);
/* Effectuate the read options for the applet itself */
while (l_arg) {

View File

@ -189,7 +189,7 @@ int hwclock_main(int argc, char **argv)
applet_long_options = hwclock_longopts;
#endif
opt_complementary = "r--ws:w--rs:s--wr:l--u:u--l";
opt = getopt32(argc, argv, "lurswf:", &rtcname);
opt = getopt32(argv, "lurswf:", &rtcname);
/* If -u or -l wasn't given check if we are using utc */
if (opt & (HWCLOCK_OPT_UTC | HWCLOCK_OPT_LOCALTIME))

View File

@ -574,7 +574,7 @@ int ipcs_main(int argc, char **argv)
#define flag_sem (1<<2)
#define flag_shm (1<<3)
opt = getopt32(argc, argv, "i:aqsmtcplu", &opt_i);
opt = getopt32(argv, "i:aqsmtcplu", &opt_i);
if (opt & 0x1) { // -i
id = xatoi(opt_i);
flags |= flag_print;

View File

@ -18,7 +18,7 @@ int losetup_main(int argc, char **argv)
char *opt_o;
unsigned long long offset = 0;
opt = getopt32(argc, argv, "do:", &opt_o);
opt = getopt32(argv, "do:", &opt_o);
argc -= optind;
argv += optind;

View File

@ -626,7 +626,7 @@ int mkfs_minix_main(int argc, char **argv)
bb_error_msg_and_die("bad inode size");
#endif
opt = getopt32(argc, argv, "ci:l:n:v", &str_i, &listfile, &str_n);
opt = getopt32(argv, "ci:l:n:v", &str_i, &listfile, &str_n);
argv += optind;
//if (opt & 1) -c
if (opt & 2) G.req_nr_inodes = xatoul(str_i); // -i

View File

@ -1554,7 +1554,7 @@ int mount_main(int argc, char **argv)
// Parse remaining options
opt = getopt32(argc, argv, "o:t:rwanfvs", &opt_o, &fstype);
opt = getopt32(argv, "o:t:rwanfvs", &opt_o, &fstype);
if (opt & 0x1) append_mount_options(&cmdopts, opt_o); // -o
//if (opt & 0x2) // -t
if (opt & 0x4) append_mount_options(&cmdopts, "ro"); // -r

View File

@ -49,7 +49,7 @@ int rdate_main(int argc, char **argv)
unsigned long flags;
opt_complementary = "-1";
flags = getopt32(argc, argv, "sp");
flags = getopt32(argv, "sp");
remote_time = askremotedate(argv[optind]);

View File

@ -67,7 +67,7 @@ int readprofile_main(int argc, char **argv)
mapFile = defaultmap;
opt_complementary = "nn:aa:bb:ss:ii:rr:vv";
getopt32(argc, argv, "M:m:p:nabsirv",
getopt32(argv, "M:m:p:nabsirv",
&mult, &mapFile, &proFile,
&optNative, &optAll, &optBins, &optSub,
&optInfo, &optReset, &optVerbose);

View File

@ -66,7 +66,7 @@ int swap_on_off_main(int argc, char **argv)
if (argc == 1)
bb_show_usage();
ret = getopt32(argc, argv, "a");
ret = getopt32(argv, "a");
if (ret)
return do_em_all();

View File

@ -74,7 +74,7 @@ int switch_root_main(int argc, char **argv)
// Parse args (-c console)
opt_complementary = "-2";
getopt32(argc, argv, "c:", &console);
getopt32(argv, "c:", &console);
argv += optind;
// Change to new root directory and verify it's a different fs.

View File

@ -38,7 +38,7 @@ int umount_main(int argc, char **argv)
/* Parse any options */
opt = getopt32(argc, argv, OPTION_STRING, &fstype);
opt = getopt32(argv, OPTION_STRING, &fstype);
argc -= optind;
argv += optind;