From f99d414667a36f9d460d257cd78af4a55d5c19fc Mon Sep 17 00:00:00 2001 From: Sara Date: Wed, 17 Sep 2025 22:00:43 +0200 Subject: [PATCH] fix: remove_die_from_active now copies data backwards and decrements active count --- src/dice.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dice.c b/src/dice.c index 9da3369..a2d6053 100644 --- a/src/dice.c +++ b/src/dice.c @@ -26,7 +26,8 @@ size_t add_die_to_active(enum die_type die) { } void remove_die_from_active(size_t index) { - memmove(active_dice_set + index + 1, active_dice_set + index, MAX_ACTIVE_DICE - index - 1); + memcpy(active_dice_set + index, active_dice_set + index + 1, MAX_ACTIVE_DICE - index - 1); + --current_active_count; } struct roll_result_type roll_active_dice_set(enum die_type die) {