Skip to content

Commit

Permalink
libgeom: Consistently use item count as the first argument to calloc
Browse files Browse the repository at this point in the history
Reported by:	GCC 14 -Wcalloc-transposed-args
Reviewed by:	rlibby, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D46006
  • Loading branch information
bsdjhb committed Jul 19, 2024
1 parent 5275d1d commit bf3b889
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libgeom/geom_xml2tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ geom_xml2tree(struct gmesh *gmp, char *p)
free(mt);
return (error);
}
gmp->lg_ident = calloc(sizeof *gmp->lg_ident, mt->nident + 1);
gmp->lg_ident = calloc(mt->nident + 1, sizeof(*gmp->lg_ident));
free(mt);
if (gmp->lg_ident == NULL)
return (ENOMEM);
Expand Down

0 comments on commit bf3b889

Please sign in to comment.