Avoid assignments in comparisons.
Add note about possible bug.
This commit is contained in:
@ -108,12 +108,14 @@ struct passwd *sgetpwent (const char *buf)
|
||||
|
||||
pwent.pw_name = fields[0];
|
||||
pwent.pw_passwd = fields[1];
|
||||
if (
|
||||
((pwent.pw_uid = strtol (fields[2], &ep, 10)) == 0 && ('\0' != *ep))) {
|
||||
pwent.pw_uid = strtol (fields[2], &ep, 10);
|
||||
/* FIXME: (0 == pwent.pw_uid) does not look correct -- nekral */
|
||||
if ((0 == pwent.pw_uid) && ('\0' != *ep)) {
|
||||
return NULL;
|
||||
}
|
||||
if (
|
||||
((pwent.pw_gid = strtol (fields[3], &ep, 10)) == 0 && ('\0' != *ep))) {
|
||||
/* FIXME: (0 == pwent.pw_gid) does not look correct -- nekral */
|
||||
pwent.pw_gid = strtol (fields[3], &ep, 10);
|
||||
if ((0 == pwent.pw_gid) && ('\0' != *ep))) {
|
||||
return NULL;
|
||||
}
|
||||
pwent.pw_gecos = fields[4];
|
||||
|
Reference in New Issue
Block a user