From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by bl2.djc.id.au (Postfix, from userid 1000) id 5001429BBD3; Sat, 17 Oct 2026 11:24:59 +1100 (AEDT) Date: Sat, 17 Oct 2026 11:25:05 +1100 To: sup-commits@supmua.dev Subject: [ncursesw-ruby.git] 07/10: fix add_wch() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Reply-To: Dan Callaghan In-Reply-To: <179219669847.381480.6906705364727468632@bl2.djc.id.au> References: <179219669847.381480.6906705364727468632@bl2.djc.id.au> Thread-Index: AQAAEjRW1ch74naHRnKg4xL7js+6AQ== X-Git-Host: bl2.djc.id.au X-Git-Repo: ncursesw-ruby.git X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 63c77b2506f6bb994f15f6bd5db25beb4754e747 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.7.dev Auto-Submitted: auto-generated Message-Id: <20261017002459.5001429BBD3@bl2.djc.id.au> From: Dan Callaghan List-Id: New commit on branch master: https://supmua.dev/git/ncursesw-ruby/commit/63c77b2506f6bb994f15f6bd5db25beb4754e747.html commit 63c77b2506f6bb994f15f6bd5db25beb4754e747 Author: Dan Callaghan AuthorDate: Sat Oct 10 16:09:26 2026 +1100 fix add_wch() Make it construct an actual cchar_t value like wadd_wch() already does, rather than wrongly casting a wchar_t. --- ncurses_wrap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ncurses_wrap.c b/ncurses_wrap.c index eb0a9b7..2b3f371 100644 --- a/ncurses_wrap.c +++ b/ncurses_wrap.c @@ -586,8 +586,8 @@ static VALUE rbncurs_addch(VALUE dummy, VALUE arg1) { } #ifdef HAVE_ADD_WCH static VALUE rbncurs_add_wch(VALUE dummy, VALUE arg1) { - wchar_t c = NUM2ULONG(arg1); - return INT2NUM(add_wch((cchar_t *)&c)); + cchar_t c = { 0, { NUM2ULONG(arg1), 0 } }; + return INT2NUM(add_wch(&c)); } #endif static VALUE rbncurs_addchnstr(VALUE dummy, VALUE arg1, VALUE arg2) {