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 authored and rphmeier committed Dec 5, 2024
1 parent 1650469 commit f8d56b8
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 f8d56b8

Please sign in to comment.