File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
vendor/cegui-0.4.0-custom/src/tinyxml Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -155,14 +155,17 @@ void TiXmlString::append( const char* str, int len )
155155 new_string = new char [new_alloc];
156156 new_string [0 ] = 0 ;
157157
158+ // cache old length before possible delete
159+ unsigned old_length = length ();
160+
158161 // copy the previous allocated buffer into this one
159162 if (allocated && cstring)
160163 // strcpy (new_string, cstring);
161- memcpy (new_string, cstring, length () );
164+ memcpy (new_string, cstring, old_length );
162165
163166 // append the suffix. It does exist, otherwize we wouldn't be expanding
164167 // strncat (new_string, str, len);
165- memcpy (new_string + length () ,
168+ memcpy (new_string + old_length ,
166169 str,
167170 size_suffix);
168171
You can’t perform that action at this time.
0 commit comments