From eea9b68bd92c5bf638b6306b5b353b49c955902a Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Sun, 25 Mar 2018 01:15:33 -0500 Subject: [PATCH] pwconv and grpconv: don't skip entries closes #60 Signed-off-by: Serge Hallyn --- src/grpconv.c | 4 +++- src/pwconv.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/grpconv.c b/src/grpconv.c index f681f07fd..646fb8edb 100644 --- a/src/grpconv.c +++ b/src/grpconv.c @@ -184,8 +184,10 @@ int main (int argc, char **argv) * Remove /etc/gshadow entries for groups not in /etc/group. */ (void) sgr_rewind (); - while ((sg = sgr_next ()) != NULL) { + sg = sgr_next (); + while (sg != NULL) { if (gr_locate (sg->sg_name) != NULL) { + sg = sgr_next (); continue; } diff --git a/src/pwconv.c b/src/pwconv.c index e2d61f875..683909ed5 100644 --- a/src/pwconv.c +++ b/src/pwconv.c @@ -223,8 +223,10 @@ int main (int argc, char **argv) * Remove /etc/shadow entries for users not in /etc/passwd. */ (void) spw_rewind (); - while ((sp = spw_next ()) != NULL) { + sp = spw_next (); + while (sp != NULL) { if (pw_locate (sp->sp_namp) != NULL) { + sp = spw_next (); continue; } -- 2.47.2