From acc07c33a660243fece1e72b658c4228a70bea33 Mon Sep 17 00:00:00 2001 From: Nigel Stewart Date: Tue, 30 Dec 2003 02:14:54 +0000 Subject: [PATCH] fgState.FPSInterval is unsigned int (GLuint), environment variable GLUT_FPS can be negative git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@425 7f0cb862-5218-0410-a997-914c9d46530a --- src/freeglut_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 0289ddd..c9e85c5 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -519,9 +519,13 @@ void FGAPIENTRY glutInit( int* pargc, char** argv ) const char *fps = getenv( "GLUT_FPS" ); if( fps ) { - sscanf( fps, "%d", &fgState.FPSInterval ); - if( fgState.FPSInterval <= 0 ) - fgState.FPSInterval = 5000; /* 5000 milliseconds */ + int interval; + sscanf( fps, "%d", &interval ); + + if( interval <= 0 ) + fgState.FPSInterval = 5000; /* 5000 millisecond default */ + else + fgState.FPSInterval = interval; } } -- 1.7.10.4