From 4590373e8dbd0176d60974cb241d8d7675106840 Mon Sep 17 00:00:00 2001 From: nigels 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: https://svn.code.sf.net/p/freeglut/code/trunk@425 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/freeglut/freeglut/src/freeglut_init.c b/freeglut/freeglut/src/freeglut_init.c index 0289ddd..c9e85c5 100644 --- a/freeglut/freeglut/src/freeglut_init.c +++ b/freeglut/freeglut/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; } }