fix bug with set_subdata

This commit is contained in:
David Rose 2010-05-31 18:51:42 +00:00
parent d73fd17eac
commit bc0529fce2
1 changed files with 4 additions and 4 deletions

View File

@ -888,8 +888,8 @@ set_subdata(size_t start, size_t size, const string &data) {
if (from_size < size) {
// Reduce the array.
unsigned char *pointer = to_buffer.get_write_pointer();
memmove(pointer + start + size,
pointer + start + from_size,
memmove(pointer + start + from_size,
pointer + start + size,
to_buffer_orig_size - (start + size));
to_buffer.clean_realloc(to_buffer_orig_size + from_size - size);
@ -897,8 +897,8 @@ set_subdata(size_t start, size_t size, const string &data) {
// Expand the array.
to_buffer.clean_realloc(to_buffer_orig_size + from_size - size);
unsigned char *pointer = to_buffer.get_write_pointer();
memmove(pointer + start + size,
pointer + start + from_size,
memmove(pointer + start + from_size,
pointer + start + size,
to_buffer_orig_size - (start + size));
}