From 5b33608f6dc707a47f0c966fc206fd795a446789 Mon Sep 17 00:00:00 2001 From: 000exploit Date: Sun, 16 Aug 2026 21:46:23 +0200 Subject: [PATCH] graphics/pdcurs34: Fixes for wide char build Signed-off-by: 000exploit --- graphics/pdcurs34/pdcurses/pdc_getstr.c | 5 ++--- graphics/pdcurs34/pdcurses/pdc_keyname.c | 4 ++-- graphics/pdcurs34/pdcurses/pdc_slk.c | 4 ++-- graphics/pdcurs34/pdcurses/pdc_util.c | 14 ++++++++++---- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/graphics/pdcurs34/pdcurses/pdc_getstr.c b/graphics/pdcurs34/pdcurses/pdc_getstr.c index 17bed774b70..ea7cf11fe7e 100644 --- a/graphics/pdcurs34/pdcurses/pdc_getstr.c +++ b/graphics/pdcurs34/pdcurses/pdc_getstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/graphics/pdcurses/pdc_getstr.c + * apps/graphics/pdcurs34/pdcurses/pdc_getstr.c * * SPDX-License-Identifier: Apache-2.0 * @@ -273,7 +273,6 @@ int wgetnstr(WINDOW *win, char *str, int n) } break; - } wrefresh(win); @@ -378,7 +377,7 @@ int wgetn_wstr(WINDOW *win, wint_t *wstr, int n) int num; int x; int chars; - char *p; + wint_t *p; bool stop; bool oldecho; bool oldcbreak; diff --git a/graphics/pdcurs34/pdcurses/pdc_keyname.c b/graphics/pdcurs34/pdcurses/pdc_keyname.c index 8a23ddb46f3..209fb358ab6 100644 --- a/graphics/pdcurs34/pdcurses/pdc_keyname.c +++ b/graphics/pdcurs34/pdcurses/pdc_keyname.c @@ -61,7 +61,7 @@ * Private Data ****************************************************************************/ -static const char *key_name[] = +static const char *names[] = { "KEY_BREAK", "KEY_DOWN", "KEY_UP", "KEY_LEFT", "KEY_RIGHT", "KEY_HOME", "KEY_BACKSPACE", "KEY_F0", "KEY_F(1)", "KEY_F(2)", @@ -138,7 +138,7 @@ const char *keyname(int key) return unctrl((chtype) key); } - return has_key(key) ? key_name[key - KEY_MIN] : "UNKNOWN KEY"; + return has_key(key) ? names[key - KEY_MIN] : "UNKNOWN KEY"; } bool has_key(int key) diff --git a/graphics/pdcurs34/pdcurses/pdc_slk.c b/graphics/pdcurs34/pdcurses/pdc_slk.c index b53d530e179..ef5132d00a0 100644 --- a/graphics/pdcurs34/pdcurses/pdc_slk.c +++ b/graphics/pdcurs34/pdcurses/pdc_slk.c @@ -55,7 +55,7 @@ * These functions manipulate a window that contain Soft Label Keys * (SLK). To use the SLK functions, a call to slk_init() must be * made BEFORE initscr() or newterm(). slk_init() removes 1 or 2 - * lines from the useable screen, depending on the format selected. + * lines from the usable screen, depending on the format selected. * * The line(s) removed from the screen are used as a separate * window, in which SLKs are displayed. @@ -362,7 +362,7 @@ char *slk_label(int labnum) #ifdef CONFIG_PDCURSES_WIDE wchar_t *wtemp = slk_wlabel(labnum); - PDC_wcstombs(temp, wtemp, 32); + PDC_wcstombs(slk_temp2, wtemp, 32); #else chtype *p; int i; diff --git a/graphics/pdcurs34/pdcurses/pdc_util.c b/graphics/pdcurs34/pdcurses/pdc_util.c index 979543efd5f..9fd466bcf11 100644 --- a/graphics/pdcurs34/pdcurses/pdc_util.c +++ b/graphics/pdcurs34/pdcurses/pdc_util.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/graphics/pdcurses/util.c + * apps/graphics/pdcurs34/pdcurses/pdc_util.c * * SPDX-License-Identifier: Apache-2.0 * @@ -114,7 +114,10 @@ char *unctrl(chtype c) #ifdef CONFIG_PDCURSES_MULTITHREAD FAR struct pdc_context_s *ctx = PDC_ctx(); #else - static char strbuf[3] = { 0, 0, 0 }; + static char strbuf[3] = + { + 0, 0, 0 + }; #endif chtype ic; @@ -210,7 +213,10 @@ wchar_t *wunctrl(cchar_t *wc) #ifdef CONFIG_PDCURSES_MULTITHREAD FAR struct pdc_context_s *ctx = PDC_ctx(); #else - static wchar_t strbuf2[3] = { 0, 0, 0 }; + static wchar_t strbuf2[3] = + { + 0, 0, 0 + }; #endif cchar_t ic; @@ -223,7 +229,7 @@ wchar_t *wunctrl(cchar_t *wc) { strbuf2[0] = (wchar_t) ic; strbuf2[1] = L'\0'; - return strbuf; + return strbuf2; } strbuf2[0] = '^'; /* '^' prefix */