From 78ead53c7ca6ac347c03c6a042049f70e8332a1f Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 4 Sep 2007 20:18:27 +0000 Subject: [PATCH] remove a weird loop that was attempting to count the length of the strings table in the progs git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7557 d7cf8633-e32d-0410-b094-e92efae38249 --- prvm_edict.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/prvm_edict.c b/prvm_edict.c index 8b269d55..947d8972 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -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; -- 2.39.2