[UXTHEME] -Apply some suggestions by Thomas.
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Thu, 18 May 2017 17:15:22 +0000 (17:15 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Thu, 18 May 2017 17:15:22 +0000 (17:15 +0000)
svn path=/trunk/; revision=74579

reactos/dll/win32/uxtheme/nonclient.c

index 6c3610d..632b158 100644 (file)
@@ -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);