]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/: Clean up after previous removal of dead code
authorAlejandro Colomar <alx@kernel.org>
Wed, 17 Jan 2024 13:31:05 +0000 (14:31 +0100)
committerSerge Hallyn <serge@hallyn.com>
Thu, 14 Mar 2024 21:12:51 +0000 (16:12 -0500)
Just cosmetic changes.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/gshadow.c
lib/shadow.c

index 8be79e81cda450d89af5d2dc3f1252626e4bd3e7..7b6f3520435fd7cc1ba7b51517e49d1bcfb5376e 100644 (file)
@@ -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;
index 34da3988d70c39a019763f380d470947363f13ff..8d2c7007d902a69d4068f7e3760e63933b9f579a 100644 (file)
@@ -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);