]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - menu.c
changed r_speeds labels again, less csqc monitoring and more consistent
[xonotic/darkplaces.git] / menu.c
diff --git a/menu.c b/menu.c
index 6033cb8bc95ae848042cbd210704888454efff2b..5958dcbf88da0eac127dcb129373a6a836bc2cc2 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -817,12 +817,13 @@ static int                loadable[MAX_SAVEGAMES];
 
 static void M_ScanSaves (void)
 {
-       int             i, j, len;
+       int             i, j;
+       size_t  len;
        char    name[MAX_OSPATH];
        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 +835,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]));