From 6c3ea4f47ea280811a7fe53a22f7832e4533c9ec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 26 Jun 2024 18:18:36 +0200 Subject: Adding upstream version 1:4.15.2. Signed-off-by: Daniel Baumann --- src/id.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/id.c') diff --git a/src/id.c b/src/id.c index 4952109..673693e 100644 --- a/src/id.c +++ b/src/id.c @@ -23,7 +23,10 @@ #include #include #include + +#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 (); -- cgit v1.2.3