Don't risk a negative array subscript. Fixes our one and only REVERSE_NEGATIVE error

Fix for Coverity error CID: 766

svn path=/trunk/; revision=36435
This commit is contained in:
Ged Murphy 2008-09-23 19:02:32 +00:00
parent b13cfee486
commit 504c3f3278

View file

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