From c95f7b1f388a3de949724dbf50088b616f444fe1 Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Tue, 22 Apr 2025 22:49:32 -0400 Subject: [PATCH] fix bug in `TB_OPT_LIBC_WCHAR` found by running tests with that option flagged on: ``` $ CFLAGS='-UTB_LIB_OPTS -DTB_OPT_LIBC_WCHAR -DTB_OPT_ATTR_W=64 -DTB_OPT_EGC' make test ``` --- termbox2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/termbox2.h b/termbox2.h index 931f1be..d1d2a41 100644 --- a/termbox2.h +++ b/termbox2.h @@ -4285,7 +4285,7 @@ static int tb_wcswidth(uint32_t *ch, size_t nch) { static int tb_iswprint_ex(uint32_t ch, int *w) { #ifdef TB_OPT_LIBC_WCHAR - if (w) w = wcwidth((wint_t)ch); + if (w) *w = wcwidth((wint_t)ch); return iswprint(ch); #else int lo = 0, hi = WCWIDTH_TABLE_LENGTH - 1; -- 2.39.5