diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-08-09 23:20:49 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-08-10 00:22:09 -0700 |
commit | ef5a4088d9236a55283d1eb576f560aa39c09e6f (patch) | |
tree | 8e385baed75dfd2ea33ce069e66f013146cb40d9 /lib/group-member.c | |
parent | 2eb92c362ecfb2dae9c9cb37cb9246df6989181c (diff) | |
download | gnulib-ef5a4088d9236a55283d1eb576f560aa39c09e6f.tar.gz |
stdckdint: prefer to intprops when easy
stdckdint.h is part of draft C23 and therefore is more likely
to be familiar to programmers in the future, so prefer it to
intprops.h in files that don’t need non-_WRAPV intprops.h macros.
* lib/alignalloc.c, lib/backupfile.c, lib/fnmatch.c, lib/fnmatch_loop.c:
* lib/group-member.c, lib/malloca.c, lib/posixtm.c, lib/reallocarray.c:
* lib/xmalloc.c:
For files that can use stdckdint.h just as easily as intprops.h,
include the former instead of the latter, and use the former’s
ckd_* macros instead of the latter’s *_WRAPV macros.
* modules/alignalloc, modules/backup-rename, modules/backupfile:
* modules/fnmatch, modules/group-member, modules/malloca:
* modules/posixtm, modules/reallocarray:
* modules/relocatable-prog-wrapper, modules/xalloc:
Depend on stdckdint instead of intprops.
Diffstat (limited to 'lib/group-member.c')
-rw-r--r-- | lib/group-member.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/group-member.c b/lib/group-member.c index 480a12616a..cd43f36f4e 100644 --- a/lib/group-member.c +++ b/lib/group-member.c @@ -21,12 +21,11 @@ /* Specification. */ #include <unistd.h> +#include <stdckdint.h> #include <stdio.h> #include <sys/types.h> #include <stdlib.h> -#include "intprops.h" - /* Most processes have no more than this many groups, and for these processes we can avoid using malloc. */ enum { GROUPBUF_SIZE = 100 }; @@ -54,7 +53,7 @@ get_group_info (struct group_info *gi) { int n_group_slots = getgroups (0, NULL); size_t nbytes; - if (! INT_MULTIPLY_WRAPV (n_group_slots, sizeof *gi->group, &nbytes)) + if (! ckd_mul (&nbytes, n_group_slots, sizeof *gi->group)) { gi->group = malloc (nbytes); if (gi->group) |