From 6eb0500d3debb909e201aacc7867bb41e2f4778f Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 6 Nov 2011 18:38:45 +0000 Subject: [PATCH] * src/faillog.c, src/chage.c, src/newusers.c, src/su.c: The getopt index of long options is not used. --- ChangeLog | 5 +++++ src/chage.c | 6 ++---- src/faillog.c | 3 +-- src/newusers.c | 3 +-- src/su.c | 5 ++--- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4e9511f..b23fcba7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-10-30 Nicolas François + + * src/faillog.c, src/chage.c, src/newusers.c, src/su.c: The getopt + index of long options is not used. + 2011-10-29 Nicolas François * lib/prototypes.h, libmisc/Makefile.am, libmisc/root_flag.c, diff --git a/src/chage.c b/src/chage.c index 37a610d2..054b96dd 100644 --- a/src/chage.c +++ b/src/chage.c @@ -381,7 +381,6 @@ static void process_flags (int argc, char **argv) /* * Parse the command line options. */ - int option_index = 0; int c; static struct option long_options[] = { {"lastday", required_argument, NULL, 'd'}, @@ -395,9 +394,8 @@ static void process_flags (int argc, char **argv) {NULL, 0, NULL, '\0'} }; - while ((c = - getopt_long (argc, argv, "d:E:hI:lm:M:W:", long_options, - &option_index)) != -1) { + while ((c = getopt_long (argc, argv, "d:E:hI:lm:M:W:", + long_options, NULL)) != -1) { switch (c) { case 'd': dflg = true; diff --git a/src/faillog.c b/src/faillog.c index 7d3aa62e..30e273c6 100644 --- a/src/faillog.c +++ b/src/faillog.c @@ -567,7 +567,6 @@ int main (int argc, char **argv) (void) textdomain (PACKAGE); { - int option_index = 0; int c; static struct option long_options[] = { {"all", no_argument, NULL, 'a'}, @@ -580,7 +579,7 @@ int main (int argc, char **argv) {NULL, 0, NULL, '\0'} }; while ((c = getopt_long (argc, argv, "ahl:m:rt:u:", - long_options, &option_index)) != -1) { + long_options, NULL)) != -1) { switch (c) { case 'a': aflg = true; diff --git a/src/newusers.c b/src/newusers.c index c4a59000..e0bfa226 100644 --- a/src/newusers.c +++ b/src/newusers.c @@ -523,7 +523,6 @@ static int add_passwd (struct passwd *pwd, const char *password) */ static void process_flags (int argc, char **argv) { - int option_index = 0; int c; static struct option long_options[] = { #ifndef USE_PAM @@ -547,7 +546,7 @@ static void process_flags (int argc, char **argv) #else /* USE_PAM */ "hr", #endif - long_options, &option_index)) != -1) { + long_options, NULL)) != -1) { switch (c) { case 'h': usage (EXIT_SUCCESS); diff --git a/src/su.c b/src/su.c index c8815e08..321a9a48 100644 --- a/src/su.c +++ b/src/su.c @@ -735,7 +735,6 @@ static void save_caller_context (char **argv) */ static void process_flags (int argc, char **argv) { - int option_index = 0; int c; static struct option long_options[] = { {"command", required_argument, NULL, 'c'}, @@ -746,8 +745,8 @@ static void process_flags (int argc, char **argv) {NULL, 0, NULL, '\0'} }; - while ((c = getopt_long (argc, argv, "c:hlmps:", long_options, - &option_index)) != -1) { + while ((c = getopt_long (argc, argv, "c:hlmps:", + long_options, NULL)) != -1) { switch (c) { case 'c': command = optarg;