From 2aa6fc1c7f50197b4d99d5de485cc2eb348c39e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petru=20R=C4=83zvan?= Date: Sun, 4 May 2025 23:28:32 +0300 Subject: [PATCH] [WORDPAD] Fix garbage in "Get Text" dialog (#7922) This fixes the garbage in the "Get Text" dialog which occurs if there is no text input and one clicks on "Get Text" under Extras. CORE-19868 Reported to Wine: https://bugs.winehq.org/show_bug.cgi?id=58144 --- base/applications/wordpad/wordpad.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/base/applications/wordpad/wordpad.c b/base/applications/wordpad/wordpad.c index 85a9be92223..8b4f3c00e28 100644 --- a/base/applications/wordpad/wordpad.c +++ b/base/applications/wordpad/wordpad.c @@ -2294,6 +2294,9 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam) tr.chrg.cpMax = nLen; tr.lpstrText = data; SendMessageW(hwndEditor, EM_GETTEXTRANGE, 0, (LPARAM)&tr); +#ifdef __REACTOS__ + data[tr.chrg.cpMax - tr.chrg.cpMin] = UNICODE_NULL; +#endif MessageBoxW(NULL, data, wszAppTitle, MB_OK); HeapFree( GetProcessHeap(), 0, data );