]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - menu.c
patch from div0 that fixes rate limiting code to make use of sv_maxrate (as it was...
[xonotic/darkplaces.git] / menu.c
diff --git a/menu.c b/menu.c
index 919adb069426554bbf0d3576ba07be4d06152497..b59b39a2c79f6bcc16c12ab95c5ad4b403e96a61 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -880,7 +880,7 @@ static void M_ScanSaves (void)
 
        for (i=0 ; i<MAX_SAVEGAMES ; i++)
        {
-               strcpy (m_filenames[i], "--- UNUSED SLOT ---");
+               strlcpy (m_filenames[i], "--- UNUSED SLOT ---", sizeof(m_filenames[i]));
                loadable[i] = false;
                sprintf (name, "s%i.sav", (int)i);
                f = FS_Open (name, "rb", false, false);
@@ -1299,7 +1299,7 @@ void M_Menu_Setup_f (void)
        key_dest = key_menu;
        m_state = m_setup;
        m_entersound = true;
-       strcpy(setup_myname, cl_name.string);
+       strlcpy(setup_myname, cl_name.string, sizeof(setup_myname));
        setup_top = setup_oldtop = cl_color.integer >> 4;
        setup_bottom = setup_oldbottom = cl_color.integer & 15;
        setup_rate = cl_rate.integer;
@@ -2647,7 +2647,7 @@ static void M_Keys_Draw (void)
 
                // LordHavoc: redesigned to print more than 2 keys, inspired by Tomaz's MiniRacer
                if (keys[0] == -1)
-                       strcpy(keystring, "???");
+                       strlcpy(keystring, "???", sizeof(keystring));
                else
                {
                        keystring[0] = 0;
@@ -2656,8 +2656,8 @@ static void M_Keys_Draw (void)
                                if (keys[j] != -1)
                                {
                                        if (j > 0)
-                                               strcat(keystring, " or ");
-                                       strcat(keystring, Key_KeynumToString (keys[j]));
+                                               strlcat(keystring, " or ", sizeof(keystring));
+                                       strlcat(keystring, Key_KeynumToString (keys[j]), sizeof(keystring));
                                }
                        }
                }
@@ -3298,7 +3298,7 @@ void M_Menu_LanConfig_f (void)
        if (StartingGame)
                lanConfig_cursor = 1;
        lanConfig_port = 26000;
-       sprintf(lanConfig_portname, "%u", lanConfig_port);
+       sprintf(lanConfig_portname, "%u", (unsigned int) lanConfig_port);
 
        M_Update_Return_Reason("");
 }
@@ -3464,7 +3464,7 @@ static void M_LanConfig_Key (int key, char ascii)
        l =  atoi(lanConfig_portname);
        if (l <= 65535)
                lanConfig_port = l;
-       sprintf(lanConfig_portname, "%u", lanConfig_port);
+       sprintf(lanConfig_portname, "%u", (unsigned int) lanConfig_port);
 }
 
 //=============================================================================