Added some error-checking (particularly w.r.t. strdup()).
[freeglut] / src / freeglut_gamemode.c
index 490d2f6..9df2835 100644 (file)
@@ -132,6 +132,8 @@ void fghRememberState( void )
 void fghRestoreState( void )
 {
 #if TARGET_HOST_UNIX_X11
+
+#   ifdef X_XF86VidModeGetAllModeLines
     /*
      * Restore the remembered pointer position:
      */
@@ -143,7 +145,6 @@ void fghRestoreState( void )
     /*
      * This highly depends on the XFree86 extensions, not approved as X Consortium standards
      */
-#   ifdef X_XF86VidModeGetAllModeLines
 
     if (fgDisplay.DisplayModeValid)
     {
@@ -497,7 +498,7 @@ int FGAPIENTRY glutEnterGameMode( void )
      * (XSetInputFocus) is called with a not yet viewable window, it will exit
      * the application which we have to aviod, so wait until it's viewable:
      */
-    while (GrabSuccess =! XGrabPointer(
+    while (GrabSuccess != XGrabPointer(
            fgDisplay.Display, fgStructure.GameMode->Window.Handle,
            TRUE, ButtonPressMask|ButtonReleaseMask|ButtonMotionMask
                |PointerMotionMask,