aboutsummaryrefslogtreecommitdiffstats
path: root/man3
diff options
context:
space:
mode:
authorAlejandro Colomar <colomar.6.4.3@gmail.com>2020-09-03 21:47:15 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2020-09-05 14:49:42 +0200
commitc6683e64ba4e4571d2e69d79793b61b4a2129f51 (patch)
tree0de334f98be2127d6623a0fc49403a4637a9b8f5 /man3
parentfacc3c56fe52eb54a5f1eb037268926d9327f770 (diff)
downloadman-pages-c6683e64ba4e4571d2e69d79793b61b4a2129f51.tar.gz
getgrouplist.3: Use sizeof consistently
Use ``sizeof`` consistently through all the examples in the following way: - Use the name of the variable instead of its type as argument for ``sizeof``. Rationale: https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man3')
-rw-r--r--man3/getgrouplist.32
1 files changed, 1 insertions, 1 deletions
diff --git a/man3/getgrouplist.3 b/man3/getgrouplist.3
index 372f2613fa..ff8d89e3f4 100644
--- a/man3/getgrouplist.3
+++ b/man3/getgrouplist.3
@@ -164,7 +164,7 @@ main(int argc, char *argv[])
ngroups = atoi(argv[2]);
- groups = malloc(sizeof(gid_t) * ngroups);
+ groups = malloc(sizeof(*groups) * ngroups);
if (groups == NULL) {
perror("malloc");
exit(EXIT_FAILURE);