diff options
| author | Alejandro Colomar <colomar.6.4.3@gmail.com> | 2020-09-03 21:47:15 +0200 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2020-09-05 14:49:42 +0200 |
| commit | c6683e64ba4e4571d2e69d79793b61b4a2129f51 (patch) | |
| tree | 0de334f98be2127d6623a0fc49403a4637a9b8f5 | |
| parent | facc3c56fe52eb54a5f1eb037268926d9327f770 (diff) | |
| download | man-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>
| -rw-r--r-- | man3/getgrouplist.3 | 2 |
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); |
