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