* libmisc/myname.c: Avoid assignments in comparisons.
* libmisc/myname.c: Avoid implicit conversion of pointers / chars to booleans. * libmisc/myname.c: Add brackets.
This commit is contained in:
parent
639b2bd8e5
commit
a2982f0d4e
@ -1,3 +1,10 @@
|
||||
2008-05-25 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/myname.c: Avoid assignments in comparisons.
|
||||
* libmisc/myname.c: Avoid implicit conversion of pointers / chars
|
||||
to booleans.
|
||||
* libmisc/myname.c: Add brackets.
|
||||
|
||||
2008-05-25 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/utmp.c (checkutmp): Change picky argument's type to
|
||||
|
@ -57,8 +57,12 @@ struct passwd *get_my_pwent (void)
|
||||
* XXX - when running from su, will return the current user (not
|
||||
* the original user, like getlogin() does). Does this matter?
|
||||
*/
|
||||
if (cp && *cp && (pw = xgetpwnam (cp)) && pw->pw_uid == ruid)
|
||||
return pw;
|
||||
if ((NULL !=cp) && ('\0' != *cp)) {
|
||||
pw = xgetpwnam (cp);
|
||||
if ((NULL != pw) && (pw->pw_uid == ruid)) {
|
||||
return pw;
|
||||
}
|
||||
}
|
||||
|
||||
return xgetpwuid (ruid);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user