py: Use memmove instead of memcpy when appropriate.

Found this bug by running unix/ tests with DEBUG=1 enabled when
compiling.
This commit is contained in:
Damien George
2014-08-29 21:07:54 +01:00
parent 02d95d7ce9
commit 17ae2395c2
3 changed files with 4 additions and 4 deletions

View File

@@ -567,7 +567,7 @@ STATIC mp_obj_t str_rsplit(uint n_args, const mp_obj_t *args) {
if (idx != 0) {
// We split less parts than split limit, now go cleanup surplus
int used = org_splits + 1 - idx;
memcpy(res->items, &res->items[idx], used * sizeof(mp_obj_t));
memmove(res->items, &res->items[idx], used * sizeof(mp_obj_t));
mp_seq_clear(res->items, used, res->alloc, sizeof(*res->items));
res->len = used;
}