overrun of static array

Fix for Coverity error CID: 546 + 547.

svn path=/trunk/; revision=36413
This commit is contained in:
Christoph von Wittich 2008-09-23 07:38:00 +00:00
parent eb68ba4328
commit db712aaf9b

View file

@ -61,7 +61,7 @@ InitStockObjects(void)
DWORD STDCALL DWORD STDCALL
GetSysColor(int nIndex) GetSysColor(int nIndex)
{ {
if(nIndex >= 0 && nIndex <= NUM_SYSCOLORS) if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
{ {
return g_psi->SysColors[nIndex]; return g_psi->SysColors[nIndex];
} }
@ -91,7 +91,7 @@ GetSysColorPen(int nIndex)
HBRUSH STDCALL HBRUSH STDCALL
GetSysColorBrush(int nIndex) GetSysColorBrush(int nIndex)
{ {
if(nIndex >= 0 && nIndex <= NUM_SYSCOLORS) if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
{ {
return g_psi->SysColorBrushes[nIndex]; return g_psi->SysColorBrushes[nIndex];
} }