fix malloc call, fix memset typo in qclib

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2958 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2008-05-14 17:27:57 +00:00
parent 35e951976f
commit 73f580157f
2 changed files with 2 additions and 2 deletions

View file

@ -278,7 +278,7 @@ void *Z_Realloc(void *data, int newsize)
void *BZF_Malloc(int size) //BZ_Malloc but allowed to fail - like straight malloc. void *BZF_Malloc(int size) //BZ_Malloc but allowed to fail - like straight malloc.
{ {
return calloc(size, 1); return malloc(size);
} }
void *BZ_Malloc(int size) //Doesn't clear. The expectation is a large file, rather than sensative data structures. void *BZ_Malloc(int size) //Doesn't clear. The expectation is a large file, rather than sensative data structures.

View file

@ -382,7 +382,7 @@ string_t PR_StringToProgs (progfuncs_t *progfuncs, char *str)
prinst->maxallocedstrings += 1024; prinst->maxallocedstrings += 1024;
ntable = memalloc(sizeof(char*) * prinst->maxallocedstrings); ntable = memalloc(sizeof(char*) * prinst->maxallocedstrings);
memcpy(ntable, prinst->allocedstrings, sizeof(char*) * prinst->numallocedstrings); memcpy(ntable, prinst->allocedstrings, sizeof(char*) * prinst->numallocedstrings);
memset(ntable + prinst->numallocedstrings, 0, sizeof(char*) * prinst->maxallocedstrings - prinst->numallocedstrings); memset(ntable + prinst->numallocedstrings, 0, sizeof(char*) * (prinst->maxallocedstrings - prinst->numallocedstrings));
prinst->numallocedstrings = prinst->maxallocedstrings; prinst->numallocedstrings = prinst->maxallocedstrings;
if (prinst->allocedstrings) if (prinst->allocedstrings)
memfree(prinst->allocedstrings); memfree(prinst->allocedstrings);