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
GetSysColor(int nIndex)
{
if(nIndex >= 0 && nIndex <= NUM_SYSCOLORS)
if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
{
return g_psi->SysColors[nIndex];
}
@ -91,7 +91,7 @@ GetSysColorPen(int nIndex)
HBRUSH STDCALL
GetSysColorBrush(int nIndex)
{
if(nIndex >= 0 && nIndex <= NUM_SYSCOLORS)
if(nIndex >= 0 && nIndex < NUM_SYSCOLORS)
{
return g_psi->SysColorBrushes[nIndex];
}