/* mgetgroups.c -- return a list of the groups a user or current process is in
- Copyright (C) 2007-2009 Free Software Foundation, Inc.
+ Copyright (C) 2007-2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
ng = (username
? getugroups (max_n_groups, g, username, gid)
- : getgroups (max_n_groups, g + (gid != (gid_t) -1)));
+ : getgroups (max_n_groups - (gid != (gid_t) -1),
+ g + (gid != (gid_t) -1)));
if (ng < 0)
{