[Tux4kids-commits] r1540 - tuxmath/trunk/src

David Bruce dbruce-guest at alioth.debian.org
Tue Sep 15 17:49:13 UTC 2009


Author: dbruce-guest
Date: 2009-09-15 17:49:13 +0000 (Tue, 15 Sep 2009)
New Revision: 1540

Modified:
   tuxmath/trunk/src/game.c
   tuxmath/trunk/src/menu.c
Log:
fixed buffer overflow error in run_lan_join()



Modified: tuxmath/trunk/src/game.c
===================================================================
--- tuxmath/trunk/src/game.c	2009-09-15 02:30:14 UTC (rev 1539)
+++ tuxmath/trunk/src/game.c	2009-09-15 17:49:13 UTC (rev 1540)
@@ -465,11 +465,13 @@
   {
     /* program exits: */
     cleanup();
+    DEBUGMSG(debug_game, "Leaving game() from window close\n");
     return 1;
   }
   else
   {
     /* return to title() screen: */
+    DEBUGMSG(debug_game, "Leaving game() normally\n");
     return game_status;
   }
 }
@@ -957,7 +959,7 @@
   }
 #endif
 
-  DEBUGMSG(debug_game, "Leaving game():\n");
+  DEBUGMSG(debug_game, "Leaving game_cleanup():\n");
 }
 
 

Modified: tuxmath/trunk/src/menu.c
===================================================================
--- tuxmath/trunk/src/menu.c	2009-09-15 02:30:14 UTC (rev 1539)
+++ tuxmath/trunk/src/menu.c	2009-09-15 17:49:13 UTC (rev 1540)
@@ -103,8 +103,8 @@
 int             run_custom_game(void);
 void            run_multiplayer(int mode, int difficulty);
 int             run_factoroids(int choice);
-int		run_lan_join(void);
-int		run_lan_host(void);
+int             run_lan_join(void);
+int             run_lan_host(void);
 
 int             run_menu(MenuNode* menu, bool return_choice);
 SDL_Surface**   render_buttons(MenuNode* menu, bool selected);
@@ -372,9 +372,9 @@
 
     case RUN_INFO:
       ShowMessage(_("TuxMath is free and open-source!"),
-                  _("You can help make it better by reporting problems,"),
-                  _("suggesting improvements, or adding code."),
-                  _("Discuss the future at tuxmath-devel at lists.sourceforge.net"));
+                  _("You can help make it better."),
+                  _("Suggestions, artwork, and code are all welcome!"),
+                  _("Discuss TuxMath at tuxmath-devel at lists.sourceforge.net"));
       break;
 
     case RUN_CREDITS:
@@ -385,6 +385,8 @@
       return QUIT;
   }
 
+  DEBUGMSG(debug_menu, "Leaving handle_activity\n");
+
   return 0;
 }
 
@@ -647,18 +649,22 @@
   {
     int stdby;
     char buf[256];
-    char player_name[32];
+    char player_name[HIGH_SCORE_NAME_LENGTH * 3];
+
     snprintf(buf, 256, _("Connected to server: %s"), LAN_ConnectedServerName());
     NameEntry(player_name, buf, _("Enter your name:"));
     LAN_SetName(player_name);
     Ready(_("Click when ready"));
     LAN_StartGame();
-    stdby = Standby(_("Waiting for other players"),_("to connect"));
+    stdby = Standby(_("Waiting for other players"), NULL);
     if (stdby == 1)
     {
+      audioMusicUnload();
       Opts_SetLanMode(1);  // Tells game() we are playing over network
       game();
       Opts_SetLanMode(0);  // Go back to local play
+      if (Opts_GetGlobalOpt(MENU_MUSIC))
+          audioMusicLoad( "tuxi.ogg", -1 );
     }
     else
     {
@@ -675,6 +681,8 @@
   ShowMessage(NULL, _("Sorry, this version built without network support"), NULL, NULL);
   printf( _("Sorry, this version built without network support.\n"));
 #endif
+
+  DEBUGMSG(debug_menu, "Leaving run_lan_join()\n"); 
   return 0;
 }
 




More information about the Tux4kids-commits mailing list