Skip to content

Commit

Permalink
testcontroller: fixed incorrect usage of memcpy()
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 25, 2024
1 parent 344546b commit 850158f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/gamepadutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]));
}
}

Expand Down

0 comments on commit 850158f

Please # to comment.