diff options
Diffstat (limited to 'src/id.c')
-rw-r--r-- | src/id.c | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -23,7 +23,10 @@ #include <pwd.h> #include <stdio.h> #include <sys/types.h> + +#include "alloc.h" #include "defines.h" + /* local function prototypes */ static void usage (void); @@ -33,7 +36,8 @@ static void usage (void) exit (EXIT_FAILURE); } - /*ARGSUSED*/ int main (int argc, char **argv) +int +main(int argc, char *argv[]) { uid_t ruid, euid; gid_t rgid, egid; @@ -63,7 +67,7 @@ static void usage (void) * work if the system library is recompiled. */ sys_ngroups = sysconf (_SC_NGROUPS_MAX); - groups = (GETGROUPS_T *) malloc (sizeof (GETGROUPS_T) * sys_ngroups); + groups = MALLOC(sys_ngroups, GETGROUPS_T); /* * See if the -a flag has been given to print out the concurrent @@ -71,11 +75,10 @@ static void usage (void) */ if (argc > 1) { - if ((argc > 2) || (strcmp (argv[1], "-a") != 0)) { - usage (); - } else { + if (argc > 2 || strcmp(argv[1], "-a") != 0) + usage(); + else aflg = true; - } } ruid = getuid (); |