list cannot be NULL in the first iteration, so we don't need a do-while.
Just in case it's not obvious: we know it's not NULL in the first
iteration because right above, in line 772, we've already dereferenced
it.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
* each name and look it up. A mix of numerical and string
* values for group identifiers is permitted.
*/
- do {
+ while (NULL != list) {
char *g;
/*
*/
user_groups[ngroups++] = xstrdup (grp->gr_name);
gr_free (grp);
- } while (NULL != list);
+ }
close_group_files ();
unlock_group_files ();
* name and look it up. A mix of numerical and string values for
* group identifiers is permitted.
*/
- do {
+ while (NULL != list) {
char *g;
/*
*/
user_groups[ngroups++] = xstrdup (grp->gr_name);
gr_free (grp);
- } while (NULL != list);
+ }
user_groups[ngroups] = NULL;