From: Dhaval Giani Date: Fri, 26 Mar 2010 14:04:34 +0000 (+0100) Subject: libcgroup: Dont assign values to variables inside if conditions X-Git-Tag: v0.36~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11873a5083b1943f6a410b1e3621815bd4226b5d;p=thirdparty%2Flibcgroup.git libcgroup: Dont assign values to variables inside if conditions Signed-off-by: Dhaval Giani --- diff --git a/src/api.c b/src/api.c index e822749f..d1d31185 100644 --- a/src/api.c +++ b/src/api.c @@ -439,7 +439,8 @@ static int cgroup_parse_rules(bool cache, uid_t muid, if (strncmp(user, "@", 1) == 0) { /* New GID rule. */ itr = &(user[1]); - if ((grp = getgrnam(itr))) { + grp = getgrnam(itr); + if (grp) { uid = CGRULE_INVALID; gid = grp->gr_gid; } else { @@ -455,7 +456,8 @@ static int cgroup_parse_rules(bool cache, uid_t muid, gid = CGRULE_WILD; } else if (*itr != '%') { /* New UID rule. */ - if ((pwd = getpwnam(user))) { + pwd = getpwnam(user); + if (pwd) { uid = pwd->pw_uid; gid = CGRULE_INVALID; } else {