From 313744b5244812fd79637e83b851220c855244e7 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Thu, 18 May 2017 17:15:22 +0000 Subject: [PATCH] [UXTHEME] -Apply some suggestions by Thomas. svn path=/trunk/; revision=74579 --- reactos/dll/win32/uxtheme/nonclient.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/uxtheme/nonclient.c b/reactos/dll/win32/uxtheme/nonclient.c index 6c3610d3e5a..632b158f2ba 100644 --- a/reactos/dll/win32/uxtheme/nonclient.c +++ b/reactos/dll/win32/uxtheme/nonclient.c @@ -119,11 +119,11 @@ HRESULT WINAPI ThemeDrawCaptionText(PDRAW_CONTEXT pcontext, RECT* pRect, int iPa len++; /* From now on this is the size of the buffer so include the null */ - if (len > 50) + if (len > ARRAYSIZE(buffer)) { - pszText = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + pszText = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (!pszText) - return E_FAIL; + return E_OUTOFMEMORY; } InternalGetWindowText(pcontext->hWnd, pszText, len); -- 2.17.1