From: Alejandro Colomar Date: Wed, 17 Jan 2024 13:31:05 +0000 (+0100) Subject: lib/: Clean up after previous removal of dead code X-Git-Tag: 4.15.1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da440b536ccdb2ec1b56ab7525b721073b5af61d;p=thirdparty%2Fshadow.git lib/: Clean up after previous removal of dead code Just cosmetic changes. Signed-off-by: Alejandro Colomar --- diff --git a/lib/gshadow.c b/lib/gshadow.c index 8be79e81c..7b6f35204 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 34da3988d..8d2c7007d 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);