svn commit: r284113 - head/usr.sbin/pw
Baptiste Daroussin
bapt at FreeBSD.org
Sun Jun 7 11:35:35 UTC 2015
Author: bapt
Date: Sun Jun 7 11:35:34 2015
New Revision: 284113
URL: https://svnweb.freebsd.org/changeset/base/284113
Log:
Improve readability by reducing indentations levels
Modified:
head/usr.sbin/pw/pw_user.c
Modified: head/usr.sbin/pw/pw_user.c
==============================================================================
--- head/usr.sbin/pw/pw_user.c Sun Jun 7 11:30:33 2015 (r284112)
+++ head/usr.sbin/pw/pw_user.c Sun Jun 7 11:35:34 2015 (r284113)
@@ -1122,15 +1122,17 @@ delete_user(struct userconf *cnf, struct
while ((grp = GETGRENT()) != NULL) {
int i, j;
char group[MAXLOGNAME];
- if (grp->gr_mem != NULL) {
- for (i = 0; grp->gr_mem[i] != NULL; i++) {
- if (!strcmp(grp->gr_mem[i], a_name->val)) {
- for (j = i; grp->gr_mem[j] != NULL; j++)
- grp->gr_mem[j] = grp->gr_mem[j+1];
- strlcpy(group, grp->gr_name, MAXLOGNAME);
- chggrent(group, grp);
- }
- }
+ if (grp->gr_mem == NULL)
+ continue;
+
+ for (i = 0; grp->gr_mem[i] != NULL; i++) {
+ if (strcmp(grp->gr_mem[i], a_name->val))
+ continue;
+
+ for (j = i; grp->gr_mem[j] != NULL; j++)
+ grp->gr_mem[j] = grp->gr_mem[j+1];
+ strlcpy(group, grp->gr_name, MAXLOGNAME);
+ chggrent(group, grp);
}
}
ENDGRENT();
More information about the svn-src-all
mailing list