Fixing a null argument to 'strdup' per e-mail from Eero Pajarre dated 6/8/2011 4...
[freeglut] / src / freeglut_init.c
index cdb9e66..57bb020 100644 (file)
@@ -314,7 +314,7 @@ static void fghInitialize( const char* displayName )
 
     /* What we need to do is to initialize the fgDisplay global structure here. */
     fgDisplay.Instance = GetModuleHandle( NULL );
-    fgDisplay.DisplayName=strdup(displayName);
+    fgDisplay.DisplayName= displayName ? strdup(displayName) : 0 ;
     atom = GetClassInfo( fgDisplay.Instance, _T("FREEGLUT"), &wc );
 
     if( atom == 0 )