From d78406b3f52c1109b66f6169a768d21ee248ba33 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 3 Apr 2015 12:54:42 +0000 Subject: [PATCH] [BROWSEUI] - Correctly handle progress dialog message strings CORE-9252 svn path=/trunk/; revision=67019 --- reactos/dll/win32/browseui/CProgressDialog.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/reactos/dll/win32/browseui/CProgressDialog.cpp b/reactos/dll/win32/browseui/CProgressDialog.cpp index be6ff2d0ca6..0a03cf3a4a2 100644 --- a/reactos/dll/win32/browseui/CProgressDialog.cpp +++ b/reactos/dll/win32/browseui/CProgressDialog.cpp @@ -50,8 +50,8 @@ CProgressDialog::CProgressDialog() this->cancelMsg = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, BUFFER_SIZE); this->title = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, BUFFER_SIZE); - this->lines[0][0] = this->lines[1][0] = this->lines[2][0] = 0; - this->cancelMsg[0] = this->title[0]; + this->lines[0][0] = this->lines[1][0] = this->lines[2][0] = UNICODE_NULL; + this->cancelMsg[0] = this->title[0] = UNICODE_NULL; this->clockHand = -1; this->progressClock[29].ullMark = 0ull; @@ -76,12 +76,11 @@ static void set_buffer(LPWSTR *buffer, LPCWSTR string) { if (!string) { - buffer[0] = 0; + (*buffer)[0] = UNICODE_NULL; return; } - ULONG len = max((wcslen(string) + 1)*sizeof(WCHAR), BUFFER_SIZE); - StringCchCopyW(*buffer, len, string); + StringCbCopyW(*buffer, BUFFER_SIZE, string); } struct create_params