]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - menu.c
fix a bunch of warnings
[xonotic/darkplaces.git] / menu.c
diff --git a/menu.c b/menu.c
index 6033cb8bc95ae848042cbd210704888454efff2b..4cc1f19d1720c68640571f47b70803236103a85d 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -822,7 +822,7 @@ static void M_ScanSaves (void)
        char    buf[SAVEGAME_COMMENT_LENGTH + 256];
        const char *t;
        qfile_t *f;
-       int             version;
+//     int             version;
 
        for (i=0 ; i<MAX_SAVEGAMES ; i++)
        {
@@ -834,11 +834,12 @@ static void M_ScanSaves (void)
                        continue;
                // read enough to get the comment
                len = FS_Read(f, buf, sizeof(buf) - 1);
-               buf[sizeof(buf) - 1] = 0;
+               len = min(len, sizeof(buf)-1);
+               buf[len] = 0;
                t = buf;
                // version
                COM_ParseToken_Simple(&t, false, false);
-               version = atoi(com_token);
+               //version = atoi(com_token);
                // description
                COM_ParseToken_Simple(&t, false, false);
                strlcpy (m_filenames[i], com_token, sizeof (m_filenames[i]));