Source SDK

SourceSDK-Logo

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s