Skip to content

Commit

Permalink
fixed bug in C comparison (thanks Jay), spaces around binary operator…
Browse files Browse the repository at this point in the history
…s, static
  • Loading branch information
mikanystrom-intel committed Jun 21, 2018
1 parent c042a28 commit 88e8bf6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions m3-libs/m3core/src/unix/Common/Uugid.c
Expand Up @@ -11,19 +11,22 @@ M3WRAP0(m3_uid_t, geteuid)
M3WRAP2(int, setreuid, m3_uid_t, m3_uid_t)
M3WRAP0(m3_gid_t, getegid)

int
static int
havegroup(gid_t qgid)
{
gid_t list[NGROUPS_MAX];
int n;
int i;

for (i = 0; i < n; ++i)
list[i] = 0;

n = getgroups(NGROUPS_MAX, list);

if (n<0) return -1;
if (n < 0) return -1;

for (i=0; i<n; ++i)
if (qgid=list[i])
for (i = 0; i < n; ++i)
if (qgid == list[i])
return 1;

return 0;
Expand Down

0 comments on commit 88e8bf6

Please sign in to comment.