mirror of
https://codeberg.org/icewind/bitbuffer.git
synced 2026-06-03 08:34:07 +02:00
more write fixes
This commit is contained in:
parent
dddb91fd6b
commit
f873005046
1 changed files with 1 additions and 1 deletions
|
|
@ -103,7 +103,7 @@ where
|
||||||
debug_assert!(count < USIZE_BITS - 8);
|
debug_assert!(count < USIZE_BITS - 8);
|
||||||
|
|
||||||
// ensure there are no stray bits
|
// ensure there are no stray bits
|
||||||
let bits = bits & (usize::MAX >> count);
|
let bits = bits & (usize::MAX >> (USIZE_BITS - count));
|
||||||
|
|
||||||
let bit_offset = self.bit_len & 7;
|
let bit_offset = self.bit_len & 7;
|
||||||
let last_written_byte = if bit_offset > 0 {
|
let last_written_byte = if bit_offset > 0 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue