Don't risk a negative array subscript. Fixes our one and only REVERSE_NEGATIVE error
authorGed Murphy <gedmurphy@reactos.org>
Tue, 23 Sep 2008 19:02:32 +0000 (19:02 +0000)
committerGed Murphy <gedmurphy@reactos.org>
Tue, 23 Sep 2008 19:02:32 +0000 (19:02 +0000)
Fix for Coverity error CID: 766

svn path=/trunk/; revision=36435

reactos/dll/cpl/desk/advappdlg.c

index 34ba5bf..6212a4b 100644 (file)
@@ -23,7 +23,6 @@ UpdateButtonColor(HWND hwndDlg, GLOBALS* g, INT ID, INT nButton, INT nColor)
        RECT rect;\r
        HBRUSH hbrush;\r
        HWND hwndColorButton;\r
-       COLORREF crColor = g->ThemeAdv.crColor[nColor];\r
        HGDIOBJ hgdiTmp;\r
 \r
        if (nColor != -1)\r
@@ -42,7 +41,7 @@ UpdateButtonColor(HWND hwndDlg, GLOBALS* g, INT ID, INT nButton, INT nColor)
                rect.top = 2;\r
                rect.right = 22;\r
                rect.bottom = 13;\r
-               hbrush = CreateSolidBrush(crColor);\r
+               hbrush = CreateSolidBrush(g->ThemeAdv.crColor[nColor]);\r
                FillRect(hdcCompat, &rect, hbrush);\r
                DeleteObject(hbrush);\r
 \r