lib/: Clean up after previous removal of dead code
Just cosmetic changes. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
33825ab57d
commit
da440b536c
@@ -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;
|
||||
|
||||
59
lib/shadow.c
59
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);
|
||||
|
||||
Reference in New Issue
Block a user