Fixing a bug in the Sierpinski sponge code that made the application crash if called with number of levels < 0
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@637 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
a84f4042f0
commit
9240a48960
@ -1096,7 +1096,7 @@ void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], G
|
|||||||
glEnd () ;
|
glEnd () ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if ( num_levels > 0 )
|
||||||
{
|
{
|
||||||
GLdouble local_offset[3] ; /* Use a local variable to avoid buildup of roundoff errors */
|
GLdouble local_offset[3] ; /* Use a local variable to avoid buildup of roundoff errors */
|
||||||
num_levels -- ;
|
num_levels -- ;
|
||||||
@ -1135,7 +1135,7 @@ void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLdouble offset[3],
|
|||||||
|
|
||||||
glEnd () ;
|
glEnd () ;
|
||||||
}
|
}
|
||||||
else
|
else if ( num_levels > 0 )
|
||||||
{
|
{
|
||||||
GLdouble local_offset[3] ; /* Use a local variable to avoid buildup of roundoff errors */
|
GLdouble local_offset[3] ; /* Use a local variable to avoid buildup of roundoff errors */
|
||||||
num_levels -- ;
|
num_levels -- ;
|
||||||
|
Reference in New Issue
Block a user