Skip to content

Commit

Permalink
memmove for overlaping memory
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerjw committed Nov 3, 2023
1 parent e276dc1 commit f55e769
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ rcutils_array_list_remove(rcutils_array_list_t * array_list, size_t index)
if (copy_count > 0) {
uint8_t * dst_ptr = rcutils_array_list_get_pointer_for_index(array_list, index);
uint8_t * src_ptr = rcutils_array_list_get_pointer_for_index(array_list, index + 1);
memcpy(dst_ptr, src_ptr, array_list->impl->data_size * copy_count);
memmove(dst_ptr, src_ptr, array_list->impl->data_size * copy_count);
}

array_list->impl->size--;
Expand Down

0 comments on commit f55e769

Please sign in to comment.