[Pkg-shadow-commits] r2028 - in upstream/trunk: . libmisc
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Sun May 25 22:15:29 UTC 2008
Author: nekral-guest
Date: 2008-05-25 22:15:28 +0000 (Sun, 25 May 2008)
New Revision: 2028
Modified:
upstream/trunk/ChangeLog
upstream/trunk/libmisc/myname.c
Log:
* libmisc/myname.c: Avoid assignments in comparisons.
* libmisc/myname.c: Avoid implicit conversion of pointers / chars
to booleans.
* libmisc/myname.c: Add brackets.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2008-05-25 22:14:19 UTC (rev 2027)
+++ upstream/trunk/ChangeLog 2008-05-25 22:15:28 UTC (rev 2028)
@@ -1,5 +1,12 @@
2008-05-25 Nicolas François <nicolas.francois at 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 at centraliens.net>
+
* libmisc/utmp.c (checkutmp): Change picky argument's type to
bool.
* libmisc/utmp.c: Use bool when possible (found_utmpx,
Modified: upstream/trunk/libmisc/myname.c
===================================================================
--- upstream/trunk/libmisc/myname.c 2008-05-25 22:14:19 UTC (rev 2027)
+++ upstream/trunk/libmisc/myname.c 2008-05-25 22:15:28 UTC (rev 2028)
@@ -57,8 +57,12 @@
* 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);
}
More information about the Pkg-shadow-commits
mailing list