From d48973bbc83c30103c62033d4fa5c07cd7ad7b31 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Mon, 9 Jun 2008 20:09:38 +0000 Subject: [PATCH] * src/groupmems.c: Move the declaration of option_index and long_options before the blocks of code. * src/groupmems.c: Ignore return value of setlocale(), bindtextdomain(), and textdomain(). * src/groupmems.c: Ignore the return value of pam_end() before exiting. --- ChangeLog | 9 +++++++++ src/groupmems.c | 14 +++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b65435e4..ff8b946c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-09 Nicolas François + + * src/groupmems.c: Move the declaration of option_index and + long_options before the blocks of code. + * src/groupmems.c: Ignore return value of setlocale(), + bindtextdomain(), and textdomain(). + * src/groupmems.c: Ignore the return value of pam_end() before + exiting. + 2008-06-09 Nicolas François * src/chfn.c: Use a bool when possible instead of int integers. diff --git a/src/groupmems.c b/src/groupmems.c index 5b983909..5cfb6d00 100644 --- a/src/groupmems.c +++ b/src/groupmems.c @@ -177,10 +177,6 @@ int main (int argc, char **argv) int retval; #endif - setlocale (LC_ALL, ""); - bindtextdomain (PACKAGE, LOCALEDIR); - textdomain (PACKAGE); - int option_index = 0; static struct option long_options[] = { {"add", required_argument, NULL, 'a'}, @@ -191,6 +187,10 @@ int main (int argc, char **argv) {NULL, 0, NULL, '\0'} }; + (void) setlocale (LC_ALL, ""); + (void) bindtextdomain (PACKAGE, LOCALEDIR); + (void) textdomain (PACKAGE); + while ((arg = getopt_long (argc, argv, "a:d:g:lp", long_options, &option_index)) != EOF) { @@ -255,14 +255,14 @@ int main (int argc, char **argv) if (retval == PAM_SUCCESS) { retval = pam_authenticate (pamh, 0); if (retval != PAM_SUCCESS) { - pam_end (pamh, retval); + (void) pam_end (pamh, retval); } } if (retval == PAM_SUCCESS) { retval = pam_acct_mgmt (pamh, 0); if (retval != PAM_SUCCESS) { - pam_end (pamh, retval); + (void) pam_end (pamh, retval); } } @@ -306,7 +306,7 @@ int main (int argc, char **argv) #ifdef USE_PAM if (retval == PAM_SUCCESS) { - pam_end (pamh, PAM_SUCCESS); + (void) pam_end (pamh, PAM_SUCCESS); } #endif /* USE_PAM */ exit (EXIT_SUCCESS);