Skip to content

Commit

Permalink
fix: bitwise_memcpy keeps untouched bits
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriele-0201 committed Nov 27, 2024
1 parent 6337edb commit 8819a9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nomt/src/beatree/ops/bit_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ pub fn bitwise_memcpy(
if let Some((mask_from, mask_to)) = maybe_masks {
let destination_chunk = {
// the destination could have less then 8 bytes available
let n_byte = std::cmp::min(8, bytes_to_write - destination_offset);
let n_byte = std::cmp::min(8, destination.len() - destination_offset);
let destination_bytes = if n_byte < 8 {
let mut buf = [0u8; 8];
buf[..n_byte].copy_from_slice(
Expand Down

0 comments on commit 8819a9f

Please sign in to comment.