For me it looks like you try to trick Coverity here. No real fix, unless you check for (nColor >= 0)
gedmurphy@svn.reactos.org schrieb:
Author: gedmurphy Date: Tue Sep 23 14:02:32 2008 New Revision: 36435
URL: http://svn.reactos.org/svn/reactos?rev=36435&view=rev Log: Don't risk a negative array subscript. Fixes our one and only REVERSE_NEGATIVE error Fix for Coverity error CID: 766
Modified: trunk/reactos/dll/cpl/desk/advappdlg.c
Modified: trunk/reactos/dll/cpl/desk/advappdlg.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advappdlg.c?re... ============================================================================== --- trunk/reactos/dll/cpl/desk/advappdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/advappdlg.c [iso-8859-1] Tue Sep 23 14:02:32 2008 @@ -23,7 +23,6 @@ RECT rect; HBRUSH hbrush; HWND hwndColorButton;
COLORREF crColor = g->ThemeAdv.crColor[nColor]; HGDIOBJ hgdiTmp;
if (nColor != -1)
@@ -42,7 +41,7 @@ rect.top = 2; rect.right = 22; rect.bottom = 13;
hbrush = CreateSolidBrush(crColor);
FillRect(hdcCompat, &rect, hbrush); DeleteObject(hbrush);hbrush = CreateSolidBrush(g->ThemeAdv.crColor[nColor]);