From bc4a25899d400ae9bdd52bbc0018792d3a19cca7 Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Fri, 17 May 2024 13:41:12 -0700 Subject: memmove vs memcpy --- magic_buddy/magic_buddy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magic_buddy/magic_buddy.c b/magic_buddy/magic_buddy.c index 3b005d0..e4942ee 100644 --- a/magic_buddy/magic_buddy.c +++ b/magic_buddy/magic_buddy.c @@ -314,7 +314,7 @@ int shrink_buddy(size_t new_size, struct buddy *state) { void move_buddy(struct buddy *new_state, struct buddy *old_state) { if (new_state == old_state) return; - memcpy(new_state, old_state, sizeof(struct buddy)); + memmove(new_state, old_state, sizeof(struct buddy)); for (size_t i = 0; i < ADDRESS_BITS; i++) { if (!new_state->avail[i]) continue; new_state->avail[i]->pprev = &(new_state->avail[i]); -- cgit v1.2.3