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
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c
index 1e6d15f..b11807d 100644
--- a/miscutils/adjtimex.c
+++ b/miscutils/adjtimex.c
@@ -56,7 +56,7 @@
const char *descript;
txc.modes=0;
- opt = getopt32(argc, argv, "qo:f:p:t:",
+ opt = getopt32(argv, "qo:f:p:t:",
&opt_o, &opt_f, &opt_p, &opt_t);
//if (opt & 0x1) // -q
if (opt & 0x2) { // -o
diff --git a/miscutils/chrt.c b/miscutils/chrt.c
index d549708..98399ce 100644
--- a/miscutils/chrt.c
+++ b/miscutils/chrt.c
@@ -52,7 +52,7 @@
int prio = 0, policy = SCHED_RR;
opt_complementary = "r--fo:f--ro:r--fo"; /* only one policy accepted */
- opt = getopt32(argc, argv, "+mp:rfo", &p_opt);
+ opt = getopt32(argv, "+mp:rfo", &p_opt);
if (opt & OPT_r)
policy = SCHED_RR;
if (opt & OPT_f)
diff --git a/miscutils/eject.c b/miscutils/eject.c
index 8d062d1..e66d74e 100644
--- a/miscutils/eject.c
+++ b/miscutils/eject.c
@@ -33,7 +33,7 @@
int dev, cmd;
opt_complementary = "?1:t--T:T--t";
- flags = getopt32(argc, argv, "tT");
+ flags = getopt32(argv, "tT");
device = argv[optind] ? : "/dev/cdrom";
// We used to do "umount <device>" here, but it was buggy
diff --git a/miscutils/less.c b/miscutils/less.c
index 046a3c4..a2221cf 100644
--- a/miscutils/less.c
+++ b/miscutils/less.c
@@ -1321,7 +1321,7 @@
/* TODO: -x: do not interpret backspace, -xx: tab also */
/* -xxx: newline also */
/* -w N: assume width N (-xxx -w 32: hex viewer of sorts) */
- getopt32(argc, argv, "EMmN~");
+ getopt32(argv, "EMmN~");
argc -= optind;
argv += optind;
num_files = argc;
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c
index 6a3e808..d36c695 100644
--- a/miscutils/makedevs.c
+++ b/miscutils/makedevs.c
@@ -78,7 +78,7 @@
int linenum = 0;
int ret = EXIT_SUCCESS;
- getopt32(argc, argv, "d:", &line);
+ getopt32(argv, "d:", &line);
if (line)
table = xfopen(line, "r");
diff --git a/miscutils/mountpoint.c b/miscutils/mountpoint.c
index b5ce35c..1f17ada 100644
--- a/miscutils/mountpoint.c
+++ b/miscutils/mountpoint.c
@@ -16,7 +16,7 @@
{
struct stat st;
char *arg;
- int opt = getopt32(argc, argv, "qdx");
+ int opt = getopt32(argv, "qdx");
#define OPT_q (1)
#define OPT_d (2)
#define OPT_x (4)
diff --git a/miscutils/strings.c b/miscutils/strings.c
index f0ef2a2..8358802 100644
--- a/miscutils/strings.c
+++ b/miscutils/strings.c
@@ -28,7 +28,7 @@
const char *fmt = "%s: ";
const char *n_arg = "4";
- opt = getopt32(argc, argv, "afon:", &n_arg);
+ opt = getopt32(argv, "afon:", &n_arg);
/* -a is our default behaviour */
/*argc -= optind;*/
argv += optind;
diff --git a/miscutils/taskset.c b/miscutils/taskset.c
index cd8ffc8..0c4bad7 100644
--- a/miscutils/taskset.c
+++ b/miscutils/taskset.c
@@ -50,7 +50,7 @@
const char *state = "current\0new";
char *p_opt = NULL, *aff = NULL;
- opt = getopt32(argc, argv, "+p:", &p_opt);
+ opt = getopt32(argv, "+p:", &p_opt);
if (opt & OPT_p) {
if (argc == optind+1) { /* -p <aff> <pid> */
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c
index b64291b..aa367d5 100644
--- a/miscutils/watchdog.c
+++ b/miscutils/watchdog.c
@@ -30,7 +30,7 @@
char *t_arg;
opt_complementary = "=1"; /* must have 1 argument */
- opts = getopt32(argc, argv, "Ft:", &t_arg);
+ opts = getopt32(argv, "Ft:", &t_arg);
if (opts & OPT_TIMER)
timer_duration = xatou(t_arg);