]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wall: fix calloc cal [-Werror=calloc-transposed-args]
authorKarel Zak <kzak@redhat.com>
Wed, 17 Jan 2024 11:37:08 +0000 (12:37 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Jan 2024 11:37:08 +0000 (12:37 +0100)
term-utils/wall.c:143:37: error: xcalloc sizes specified with sizeof in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
  143 |         buf->groups = xcalloc(sizeof(*buf->groups), buf->ngroups);
      |                                     ^
term-utils/wall.c:143:37: note: earlier argument should specify number of elements, later size of each element

Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/wall.c

index a3fe7d29a6a79be5b1e8e1d0a7016d128630f51e..f894a32f862f3425437d43c855c0497c9fdd660d 100644 (file)
@@ -140,7 +140,7 @@ static struct group_workspace *init_group_workspace(const char *group)
 
        buf->requested_group = get_group_gid(group);
        buf->ngroups = sysconf(_SC_NGROUPS_MAX) + 1;  /* room for the primary gid */
-       buf->groups = xcalloc(sizeof(*buf->groups), buf->ngroups);
+       buf->groups = xcalloc(buf->ngroups, sizeof(*buf->groups));
 
        return buf;
 }