From ce4e74c1b9bc605e44770108292b215e0d7fea23 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Mon, 31 Dec 2007 15:27:23 +0000 Subject: [PATCH] Avoid implicit brackets. --- ChangeLog | 1 + src/chsh.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8457a53..b0556a71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ out of main(). * src/chsh.c: Before pam_end(), the return value of the previous pam API was already checked. No need to validate it again. + * src/chsh.c: Avoid implicit brackets. 2007-12-31 Nicolas François diff --git a/src/chsh.c b/src/chsh.c index 707f2f99..1bb97cbf 100644 --- a/src/chsh.c +++ b/src/chsh.c @@ -142,8 +142,9 @@ static int check_shell (const char *sh) #ifdef HAVE_GETUSERSHELL setusershell (); while ((cp = getusershell ())) { - if (*cp == '#') + if (*cp == '#') { continue; + } if (strcmp (cp, sh) == 0) { found = 1; @@ -156,11 +157,13 @@ static int check_shell (const char *sh) return 0; while (fgets (buf, sizeof (buf), fp)) { - if ((cp = strrchr (buf, '\n'))) + if ((cp = strrchr (buf, '\n'))) { *cp = '\0'; + } - if (buf[0] == '#') + if (buf[0] == '#') { continue; + } if (strcmp (buf, sh) == 0) { found = 1; @@ -499,8 +502,9 @@ int main (int argc, char **argv) * Now get the login shell. Either get it from the password * file, or use the value from the command line. */ - if (!sflg) + if (!sflg) { STRFCPY (loginsh, pw->pw_shell); + } /* * If the login shell was not set on the command line, let the user @@ -541,3 +545,4 @@ int main (int argc, char **argv) closelog (); exit (E_SUCCESS); } +