From f85b5c222fccb37fd3c908cc64f9aec25421191c Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Thu, 27 Mar 2025 05:51:36 +0000 Subject: [PATCH] Revert "BitBuffer: Allow copy right/left on same instance" This reverts commit cfeddbf8b6320a21749238d648eff7e69450d850. --- lib/toolbox/bit_buffer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/toolbox/bit_buffer.c b/lib/toolbox/bit_buffer.c index 2d8057c3d..e261e80d4 100644 --- a/lib/toolbox/bit_buffer.c +++ b/lib/toolbox/bit_buffer.c @@ -60,7 +60,7 @@ void bit_buffer_copy_right(BitBuffer* buf, const BitBuffer* other, size_t start_ furi_check(bit_buffer_get_size_bytes(other) > start_index); furi_check(buf->capacity_bytes >= bit_buffer_get_size_bytes(other) - start_index); - memmove(buf->data, other->data + start_index, bit_buffer_get_size_bytes(other) - start_index); + memcpy(buf->data, other->data + start_index, bit_buffer_get_size_bytes(other) - start_index); buf->size_bits = other->size_bits - start_index * BITS_IN_BYTE; } @@ -70,9 +70,7 @@ void bit_buffer_copy_left(BitBuffer* buf, const BitBuffer* other, size_t end_ind furi_check(bit_buffer_get_capacity_bytes(buf) >= end_index); furi_check(bit_buffer_get_size_bytes(other) >= end_index); - if(buf != other) { - memcpy(buf->data, other->data, end_index); - } + memcpy(buf->data, other->data, end_index); buf->size_bits = end_index * BITS_IN_BYTE; }