Avoid out-of-bounds array index
This commit is contained in:
@@ -183,7 +183,7 @@ namespace
|
|||||||
|
|
||||||
int CTWeightToWX(CGFloat weight)
|
int CTWeightToWX(CGFloat weight)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < kCTWeightsCount; ++i)
|
for (int i = 0; i < kCTWeightsCount - 1; ++i)
|
||||||
{
|
{
|
||||||
if ( (weight - gCTWeights[i]) < (gCTWeights[i+1]-weight) )
|
if ( (weight - gCTWeights[i]) < (gCTWeights[i+1]-weight) )
|
||||||
return i * 100;
|
return i * 100;
|
||||||
|
Reference in New Issue
Block a user