From: Karel Zak Date: Wed, 17 Jan 2024 11:37:08 +0000 (+0100) Subject: wall: fix calloc cal [-Werror=calloc-transposed-args] X-Git-Tag: v2.40-rc1~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07f0f0f5bd1e5e2268257ae1ff6d76a9b6c6ea8b;p=thirdparty%2Futil-linux.git wall: fix calloc cal [-Werror=calloc-transposed-args] 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 --- diff --git a/term-utils/wall.c b/term-utils/wall.c index a3fe7d29a6..f894a32f86 100644 --- a/term-utils/wall.c +++ b/term-utils/wall.c @@ -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; }