Skip to content

Commit

Permalink
src/usermod.c: Reduce scope of local variables
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Colomar <[email protected]>
  • Loading branch information
alejandro-colomar authored and ikerexxe committed May 20, 2024
1 parent 1ee066a commit 151f14a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/usermod.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,8 @@ fail_exit (int code)

static void update_group (void)
{
bool is_member;
bool was_member;
bool changed;
const struct group *grp;
struct group *ngrp;
bool changed;
const struct group *grp;

changed = false;

Expand All @@ -700,6 +697,9 @@ static void update_group (void)
* the user is a member of.
*/
while ((grp = gr_next ()) != NULL) {
bool is_member;
bool was_member;
struct group *ngrp;
/*
* See if the user specified this group as one of their
* concurrent groups.
Expand Down Expand Up @@ -799,12 +799,8 @@ static void update_group (void)
#ifdef SHADOWGRP
static void update_gshadow (void)
{
bool is_member;
bool was_member;
bool was_admin;
bool changed;
const struct sgrp *sgrp;
struct sgrp *nsgrp;
bool changed;
const struct sgrp *sgrp;

changed = false;

Expand All @@ -813,6 +809,10 @@ static void update_gshadow (void)
* that the user is a member of.
*/
while ((sgrp = sgr_next ()) != NULL) {
bool is_member;
bool was_member;
bool was_admin;
struct sgrp *nsgrp;

/*
* See if the user was a member of this group
Expand Down

0 comments on commit 151f14a

Please sign in to comment.