aboutsummaryrefslogtreecommitdiffstats
path: root/man3
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-10-25 21:44:37 +0200
committerAlejandro Colomar <alx.manpages@gmail.com>2021-10-25 22:10:12 +0200
commitc59aa7fc414eb3394ace200e4c71511232ef5801 (patch)
tree028af9b6569addba31dce854c2054b5e19b6dd21 /man3
parent78ab0ddffce32250f69880a00f99c5042960bd04 (diff)
downloadman-pages-c59aa7fc414eb3394ace200e4c71511232ef5801.tar.gz
getgrouplist.3: Place variable definitions on top of function
Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'man3')
-rw-r--r--man3/getgrouplist.33
1 files changed, 2 insertions, 1 deletions
diff --git a/man3/getgrouplist.3 b/man3/getgrouplist.3
index 1fe260bda2..5332963701 100644
--- a/man3/getgrouplist.3
+++ b/man3/getgrouplist.3
@@ -163,6 +163,7 @@ main(int argc, char *argv[])
int ngroups;
struct passwd *pw;
struct group *gr;
+ gid_t *groups;
if (argc != 3) {
fprintf(stderr, "Usage: %s <user> <ngroups>\en", argv[0]);
@@ -171,7 +172,7 @@ main(int argc, char *argv[])
ngroups = atoi(argv[2]);
- gid_t *groups = malloc(sizeof(*groups) * ngroups);
+ groups = malloc(sizeof(*groups) * ngroups);
if (groups == NULL) {
perror("malloc");
exit(EXIT_FAILURE);