mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
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:
parent
f21c3be67a
commit
51f473ade8
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user