X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=tools%2Fquake3%2Fq3map2%2Fbspfile_abstract.c;h=ef78160f737ad15bd9e35586f09f33aafd53f54e;hb=778563508dd51f2251355a57d9e063f467b1fbc7;hp=0e77526fc5d845833be848311f2e38b150602770;hpb=d909e5b8c7b4ccf8a7a0fea6e77e49d021398bb3;p=xonotic%2Fnetradiant.git diff --git a/tools/quake3/q3map2/bspfile_abstract.c b/tools/quake3/q3map2/bspfile_abstract.c index 0e77526f..ef78160f 100644 --- a/tools/quake3/q3map2/bspfile_abstract.c +++ b/tools/quake3/q3map2/bspfile_abstract.c @@ -642,13 +642,22 @@ void UnparseEntities( void ) /* setup */ + AUTOEXPAND_BY_REALLOC(bspEntData, 0, allocatedBSPEntData, 1024); buf = bspEntData; end = buf; *end = 0; + /* run through entity list */ for( i = 0; i < numBSPEntities && i < numEntities; i++ ) { + { + int sz = end - buf; + AUTOEXPAND_BY_REALLOC(bspEntData, sz + 65536, allocatedBSPEntData, 1024); + buf = bspEntData; + end = buf + sz; + } + /* get epair */ ep = entities[ i ].epairs; if( ep == NULL ) @@ -685,7 +694,7 @@ void UnparseEntities( void ) end += 2; /* check for overflow */ - if( end > buf + MAX_MAP_ENTSTRING ) + if( end > buf + allocatedBSPEntData ) Error( "Entity text too long" ); }