Use memmove instead of memcpy when dest and src buffers are overlapping.