]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
remove a weird loop that was attempting to count the length of the
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 4 Sep 2007 20:18:27 +0000 (20:18 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 4 Sep 2007 20:18:27 +0000 (20:18 +0000)
strings table in the progs

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7557 d7cf8633-e32d-0410-b094-e92efae38249

prvm_edict.c

index 8b269d55370127737203a63d591d19cd74bdffdc..947d8972433e6083e7267a86ff9b80750c366f75 100644 (file)
@@ -1584,14 +1584,11 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required
        //prog->functions = (dfunction_t *)((unsigned char *)progs + progs->ofs_functions);
        dfunctions = (dfunction_t *)((unsigned char *)prog->progs + prog->progs->ofs_functions);
 
+       if (prog->progs->ofs_strings + prog->progs->numstrings >= (int)filesize)
+               PRVM_ERROR ("%s: %s strings go past end of file", PRVM_NAME, filename);
        prog->strings = (char *)prog->progs + prog->progs->ofs_strings;
-       prog->stringssize = 0;
-       for (i = 0;i < prog->progs->numstrings;i++)
-       {
-               if (prog->progs->ofs_strings + prog->stringssize >= (int)filesize)
-                       PRVM_ERROR ("%s: %s strings go past end of file", PRVM_NAME, filename);
-               prog->stringssize += (int)strlen (prog->strings + prog->stringssize) + 1;
-       }
+       prog->stringssize = prog->progs->numstrings;
+
        prog->numknownstrings = 0;
        prog->maxknownstrings = 0;
        prog->knownstrings = NULL;