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 )
155
155
new_string = new char [new_alloc];
156
156
new_string [0 ] = 0 ;
157
157
158
+ // cache old length before possible delete
159
+ unsigned old_length = length ();
160
+
158
161
// copy the previous allocated buffer into this one
159
162
if (allocated && cstring)
160
163
// strcpy (new_string, cstring);
161
- memcpy (new_string, cstring, length () );
164
+ memcpy (new_string, cstring, old_length );
162
165
163
166
// append the suffix. It does exist, otherwize we wouldn't be expanding
164
167
// strncat (new_string, str, len);
165
- memcpy (new_string + length () ,
168
+ memcpy (new_string + old_length ,
166
169
str,
167
170
size_suffix);
168
171
You can’t perform that action at this time.
0 commit comments