A typo in a nested loop
V534 It is likely that a wrong variable is being compared inside the ‘for’ operator. Consider reviewing ‘i’. beamdraw.cpp 592
void DrawTeslaSegs(....) { int i; .... for ( i = 0; i < segments; i++ ) { .... for ( int j = 0; i < iBranches; j++ ) { curSeg.m_flWidth *= 0.5; } .... } .... }
Note the second loop:
for ( int j = 0; i < iBranches; j++ )
The termination condition for the nested loop contains the ‘i‘ variable related to the external loop. Probably it’s a typo.
Please click here to see more bugs from this project.