From bff53ab1149474dee13418b0ce7f1a9b0e1e2582 Mon Sep 17 00:00:00 2001 From: Julius Ikkala Date: Sat, 4 Mar 2023 16:11:26 +0200 Subject: [PATCH] Fix text selection memory corruption with long codepoints --- pdcurses/getch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdcurses/getch.c b/pdcurses/getch.c index b136a26a..db360969 100644 --- a/pdcurses/getch.c +++ b/pdcurses/getch.c @@ -228,7 +228,7 @@ static void _copy(void) #ifdef PDC_WIDE wtmp = (wchar_t *)malloc((len + 1) * sizeof(wchar_t)); - len *= 3; + len *= 4; #endif tmp = (char *)malloc(len + 1);