]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
remove some unsafe optimizations in VM_Files_Init and VM_Files_CloseAll (using memset...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 12 Sep 2006 05:56:26 +0000 (05:56 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 12 Sep 2006 05:56:26 +0000 (05:56 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6582 d7cf8633-e32d-0410-b094-e92efae38249

prvm_cmds.c

index 7d43ad99095d0c113e3aa96ed274161660f1ee81..b3e2e97e0079d71ea4497114549fe43966ea726f 100644 (file)
@@ -1505,7 +1505,9 @@ setcolor(clientent, value)
 
 void VM_Files_Init(void)
 {
-       memset(VM_FILES, 0, sizeof(qfile_t*[MAX_VMFILES]));
+       int i;
+       for (i = 0;i < MAX_VMFILES;i++)
+               VM_FILES[i] = NULL;
 }
 
 void VM_Files_CloseAll(void)
@@ -1515,9 +1517,8 @@ void VM_Files_CloseAll(void)
        {
                if (VM_FILES[i])
                        FS_Close(VM_FILES[i]);
-               //VM_FILES[i] = NULL;
+               VM_FILES[i] = NULL;
        }
-       memset(VM_FILES,0,sizeof(qfile_t*[MAX_VMFILES])); // this should be faster (is it ?)
 }
 
 qfile_t *VM_GetFileHandle( int index )