Skip to content

Commit

Permalink
fix egc memory error
Browse files Browse the repository at this point in the history
this was copying too many bytes to the dest cell (8-bytes for a
pointer vs 4-bytes for a uint32_t).
  • Loading branch information
adsr committed Dec 18, 2024
1 parent 25c3f8b commit b89b08c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion termbox2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3324,7 +3324,7 @@ static int cell_set(struct tb_cell *cell, uint32_t *ch, size_t nch,
} else {
int rv;
if_err_return(rv, cell_reserve_ech(cell, nch + 1));
memcpy(cell->ech, ch, sizeof(ch) * nch);
memcpy(cell->ech, ch, sizeof(*ch) * nch);
cell->ech[nch] = '\0';
cell->nech = nch;
}
Expand Down

0 comments on commit b89b08c

Please sign in to comment.