From 850158f83f3e311dbb741d85ca0e3f5cb12152a8 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 24 Oct 2024 18:11:19 -0700
Subject: [PATCH] testcontroller: fixed incorrect usage of memcpy()
---
test/gamepadutils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/gamepadutils.c b/test/gamepadutils.c
index 978d86ed57bd4..072bd945c908a 100644
--- a/test/gamepadutils.c
+++ b/test/gamepadutils.c
@@ -2263,8 +2263,8 @@ static void RemoveMappingValueAt(MappingParts *parts, int index)
SDL_free(parts->values[index]);
--parts->num_elements;
if (index < parts->num_elements) {
- SDL_memcpy(&parts->keys[index], &parts->keys[index] + 1, (parts->num_elements - index) * sizeof(parts->keys[index]));
- SDL_memcpy(&parts->values[index], &parts->values[index] + 1, (parts->num_elements - index) * sizeof(parts->values[index]));
+ SDL_memmove(&parts->keys[index], &parts->keys[index] + 1, (parts->num_elements - index) * sizeof(parts->keys[index]));
+ SDL_memmove(&parts->values[index], &parts->values[index] + 1, (parts->num_elements - index) * sizeof(parts->values[index]));
}
}