]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - menu.c
experimental makefile option make DP_LINK_TO_JPEG=1 - use libjpeg.h instead of dynami...
[xonotic/darkplaces.git] / menu.c
diff --git a/menu.c b/menu.c
index d576a10c018289983ee50dda23665e0ef5d3ead4..7417844b5d67a72792e3837e14c9fd45db3c7917 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -105,7 +105,7 @@ static void M_GameOptions_Key (int key, int ascii);
 static void M_ServerList_Key (int key, int ascii);
 static void M_ModList_Key (int key, int ascii);
 
-static qboolean        m_entersound;           // play after drawing a frame, so caching won't disrupt the sound
+static qboolean        m_entersound;           ///< play after drawing a frame, so caching won't disrupt the sound
 
 void M_Update_Return_Reason(char *s)
 {
@@ -810,7 +810,7 @@ static void M_SinglePlayer_Key (int key, int ascii)
 //=============================================================================
 /* LOAD/SAVE MENU */
 
-static int             load_cursor;            // 0 < load_cursor < MAX_SAVEGAMES
+static int             load_cursor;            ///< 0 < load_cursor < MAX_SAVEGAMES
 
 #define        MAX_SAVEGAMES           12
 static char    m_filenames[MAX_SAVEGAMES][SAVEGAME_COMMENT_LENGTH+1];
@@ -3177,7 +3177,7 @@ static int M_ChooseQuitMessage(int request)
                break;
        }
        return 0;
-};
+}
 
 void M_Menu_Quit_f (void)
 {
@@ -3257,7 +3257,7 @@ static int                lanConfig_cursor_table [] = {56, 76, 84, 120};
 
 static int     lanConfig_port;
 static char    lanConfig_portname[6];
-static char    lanConfig_joinname[22];
+static char    lanConfig_joinname[40];
 
 void M_Menu_LanConfig_f (void)
 {
@@ -3301,7 +3301,7 @@ static void M_LanConfig_Draw (void)
        basex += 8;
 
        M_Print(basex, lanConfig_cursor_table[0], "Port");
-       M_DrawTextBox (basex+8*8, lanConfig_cursor_table[0]-8, 6, 1);
+       M_DrawTextBox (basex+8*8, lanConfig_cursor_table[0]-8, sizeof(lanConfig_portname), 1);
        M_Print(basex+9*8, lanConfig_cursor_table[0], lanConfig_portname);
 
        if (JoiningGame)
@@ -3309,7 +3309,7 @@ static void M_LanConfig_Draw (void)
                M_Print(basex, lanConfig_cursor_table[1], "Search for DarkPlaces games...");
                M_Print(basex, lanConfig_cursor_table[2], "Search for QuakeWorld games...");
                M_Print(basex, lanConfig_cursor_table[3]-16, "Join game at:");
-               M_DrawTextBox (basex+8, lanConfig_cursor_table[3]-8, 22, 1);
+               M_DrawTextBox (basex+8, lanConfig_cursor_table[3]-8, sizeof(lanConfig_joinname), 1);
                M_Print(basex+16, lanConfig_cursor_table[3], lanConfig_joinname);
        }
        else
@@ -3407,7 +3407,7 @@ static void M_LanConfig_Key (int key, int ascii)
                if (lanConfig_cursor == 3)
                {
                        l = (int)strlen(lanConfig_joinname);
-                       if (l < 21)
+                       if (l < (int)sizeof(lanConfig_joinname) - 1)
                        {
                                lanConfig_joinname[l+1] = 0;
                                lanConfig_joinname[l] = ascii;
@@ -3419,7 +3419,7 @@ static void M_LanConfig_Key (int key, int ascii)
                if (lanConfig_cursor == 0)
                {
                        l = (int)strlen(lanConfig_portname);
-                       if (l < 5)
+                       if (l < (int)sizeof(lanConfig_portname) - 1)
                        {
                                lanConfig_portname[l+1] = 0;
                                lanConfig_portname[l] = ascii;
@@ -5245,7 +5245,7 @@ void MR_Init_Commands(void)
        // set router console commands
        Cvar_RegisterVariable (&forceqmenu);
        Cvar_RegisterVariable (&menu_options_colorcontrol_correctionvalue);
-       Cmd_AddCommand ("menu_restart",MR_Restart, "restart menu system (reloads menu.dat");
+       Cmd_AddCommand ("menu_restart",MR_Restart, "restart menu system (reloads menu.dat)");
        Cmd_AddCommand ("togglemenu", Call_MR_ToggleMenu_f, "opens or closes menu");
 }