fix transposed arguments to calloc()

calloc() wants the number of members followed by the
size of each member. obviously the product is the same
either way, but there could be alignment problems if
the arguments are transposed, as they were here.
This commit is contained in:
nick black 2024-10-02 02:18:42 -04:00
parent f21c3be67a
commit 51f473ade8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -580,7 +580,7 @@ int ncplane_mergedown(ncplane* restrict src, ncplane* restrict dst,
return -1;
}
const int totalcells = dst->leny * dst->lenx;
nccell* rendfb = calloc(sizeof(*rendfb), totalcells);
nccell* rendfb = calloc(totalcells, sizeof(*rendfb));
const size_t crenderlen = sizeof(struct crender) * totalcells;
struct crender* rvec = malloc(crenderlen);
if(!rendfb || !rvec){