diff options
author | Alejandro Colomar <alx@kernel.org> | 2024-01-17 14:31:05 +0100 |
---|---|---|
committer | Serge Hallyn <serge@hallyn.com> | 2024-03-14 16:12:51 -0500 |
commit | da440b536ccdb2ec1b56ab7525b721073b5af61d (patch) | |
tree | cbd0af31310ea136b9ea64a085e170e05e65acae | |
parent | 33825ab57d166ea32e07a6106ea45287d3fbaeee (diff) |
lib/: Clean up after previous removal of dead code
Just cosmetic changes.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r-- | lib/gshadow.c | 6 | ||||
-rw-r--r-- | lib/shadow.c | 59 |
2 files changed, 23 insertions, 42 deletions
diff --git a/lib/gshadow.c b/lib/gshadow.c index 8be79e81..7b6f3520 100644 --- a/lib/gshadow.c +++ b/lib/gshadow.c @@ -122,9 +122,8 @@ void endsgent (void) * the line is invalid. */ - if ((NULL != cp) || (i != FIELDS)) { + if (NULL != cp || i != FIELDS) return 0; - } sgroup.sg_name = fields[0]; sgroup.sg_passwd = fields[1]; @@ -170,8 +169,7 @@ void endsgent (void) return NULL; } - if (fgetsx (buf, buflen, fp) == buf) - { + if (fgetsx(buf, buflen, fp) == buf) { while ( ((cp = strrchr (buf, '\n')) == NULL) && (feof (fp) == 0)) { size_t len; diff --git a/lib/shadow.c b/lib/shadow.c index 34da3988..8d2c7007 100644 --- a/lib/shadow.c +++ b/lib/shadow.c @@ -116,11 +116,10 @@ static struct spwd *my_sgetspent (const char *string) if (fields[2][0] == '\0') { spwd.sp_lstchg = -1; } else { - if (getlong(fields[2], &spwd.sp_lstchg) == -1) { - return 0; - } else if (spwd.sp_lstchg < 0) { + if (getlong(fields[2], &spwd.sp_lstchg) == -1) + return 0; + if (spwd.sp_lstchg < 0) return 0; - } } /* @@ -130,13 +129,10 @@ static struct spwd *my_sgetspent (const char *string) if (fields[3][0] == '\0') { spwd.sp_min = -1; } else { - if (getlong(fields[3], &spwd.sp_min) == -1) { - { - return 0; - } - } else if (spwd.sp_min < 0) { + if (getlong(fields[3], &spwd.sp_min) == -1) + return 0; + if (spwd.sp_min < 0) return 0; - } } /* @@ -146,11 +142,10 @@ static struct spwd *my_sgetspent (const char *string) if (fields[4][0] == '\0') { spwd.sp_max = -1; } else { - if (getlong(fields[4], &spwd.sp_max) == -1) { - return 0; - } else if (spwd.sp_max < 0) { + if (getlong(fields[4], &spwd.sp_max) == -1) + return 0; + if (spwd.sp_max < 0) return 0; - } } /* @@ -174,13 +169,10 @@ static struct spwd *my_sgetspent (const char *string) if (fields[5][0] == '\0') { spwd.sp_warn = -1; } else { - if (getlong(fields[5], &spwd.sp_warn) == -1) { - { - return 0; - } - } else if (spwd.sp_warn < 0) { + if (getlong(fields[5], &spwd.sp_warn) == -1) + return 0; + if (spwd.sp_warn < 0) return 0; - } } /* @@ -191,13 +183,10 @@ static struct spwd *my_sgetspent (const char *string) if (fields[6][0] == '\0') { spwd.sp_inact = -1; } else { - if (getlong(fields[6], &spwd.sp_inact) == -1) { - { - return 0; - } - } else if (spwd.sp_inact < 0) { + if (getlong(fields[6], &spwd.sp_inact) == -1) + return 0; + if (spwd.sp_inact < 0) return 0; - } } /* @@ -208,13 +197,10 @@ static struct spwd *my_sgetspent (const char *string) if (fields[7][0] == '\0') { spwd.sp_expire = -1; } else { - if (getlong(fields[7], &spwd.sp_expire) == -1) { - { - return 0; - } - } else if (spwd.sp_expire < 0) { + if (getlong(fields[7], &spwd.sp_expire) == -1) + return 0; + if (spwd.sp_expire < 0) return 0; - } } /* @@ -225,13 +211,10 @@ static struct spwd *my_sgetspent (const char *string) if (fields[8][0] == '\0') { spwd.sp_flag = SHADOW_SP_FLAG_UNSET; } else { - if (getulong(fields[8], &spwd.sp_flag) == -1) { - { - return 0; - } - } else if (spwd.sp_flag < 0) { + if (getulong(fields[8], &spwd.sp_flag) == -1) + return 0; + if (spwd.sp_flag < 0) return 0; - } } return (&spwd); |