+2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/groups.c: sys_ngroups is only used when HAVE_GETGROUPS is
+ defined.
+
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
* src/faillog.c: Ignore return value of time() when use with a
*/
int main (int argc, char **argv)
{
- long sys_ngroups;
-
#ifdef HAVE_GETGROUPS
+ long sys_ngroups;
int ngroups;
GETGROUPS_T *groups;
int pri_grp; /* TODO: should be GETGROUPS_T */
char *getlogin ();
#endif
- sys_ngroups = sysconf (_SC_NGROUPS_MAX);
#ifdef HAVE_GETGROUPS
- groups = (GETGROUPS_T *) malloc (sys_ngroups * sizeof (GETGROUPS_T));
+ sys_ngroups = sysconf (_SC_NGROUPS_MAX);
+ groups = (GETGROUPS_T *) malloc (sizeof (GETGROUPS_T) * sys_ngroups);
#endif
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);