From 2573a080d1428ca682e70e1999ac52d4447f8e6e Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 24 Jan 2008 21:43:55 +0000 Subject: [PATCH] Expandable arrays: memset to zero newly returned records (to be consistent with Mem_Alloc). Fixes bug with string buffers. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8005 d7cf8633-e32d-0410-b094-e92efae38249 --- zone.c | 1 + 1 file changed, 1 insertion(+) diff --git a/zone.c b/zone.c index 2ab390bd..175b25a6 100644 --- a/zone.c +++ b/zone.c @@ -431,6 +431,7 @@ void *Mem_ExpandableArray_AllocRecord(memexpandablearray_t *l) { l->arrays[i].allocflags[j] = true; l->arrays[i].numflaggedrecords++; + memset(l->arrays[i].data + l->recordsize * j, 0, l->recordsize); return (void *)(l->arrays[i].data + l->recordsize * j); } } -- 2.39.2