From b89b08cf411db2373b9254b8e27caa308f0b5bde Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Tue, 17 Dec 2024 22:52:59 -0500 Subject: [PATCH] fix egc memory error this was copying too many bytes to the dest cell (8-bytes for a pointer vs 4-bytes for a uint32_t). --- termbox2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/termbox2.h b/termbox2.h index 30ed32f..0860a0e 100644 --- a/termbox2.h +++ b/termbox2.h @@ -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; }