]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
sorry Mathieu, can't use va() in filesystem code, not safe. (this was causing the...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 1 Jan 2004 10:25:05 +0000 (10:25 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 1 Jan 2004 10:25:05 +0000 (10:25 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3776 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index 8ba6759bbc5051ab3c297bbfd80995ec673673a2..13203ec51e309bad14bb4998d2cff342be0d833c 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -1103,9 +1103,8 @@ static searchpath_t *FS_FindFile (const char *name, int* index, qboolean quiet)
                }
                else
                {
                }
                else
                {
-                       char* netpath;
-
-                       netpath = va ("%s/%s", search->filename, name);
+                       char netpath[MAX_OSPATH];
+                       snprintf(netpath, sizeof(netpath), "%s/%s", search->filename, name);
                        if (FS_SysFileExists (netpath))
                        {
                                if (!quiet)
                        if (FS_SysFileExists (netpath))
                        {
                                if (!quiet)
@@ -1155,7 +1154,11 @@ qfile_t *FS_FOpenFile (const char *filename, qboolean quiet)
 
        // Found in the filesystem?
        if (i < 0)
 
        // Found in the filesystem?
        if (i < 0)
-               return FS_OpenRead (va ("%s/%s", search->filename, filename), -1, -1);
+       {
+               char netpath[MAX_OSPATH];
+               snprintf(netpath, sizeof(netpath), "%s/%s", search->filename, filename);
+               return FS_OpenRead(netpath, -1, -1);
+       }
 
        // So, we found it in a package...
        packfile = &search->pack->files[i];
 
        // So, we found it in a package...
        packfile = &search->pack->files[i];