Skip to content

Commit

Permalink
fix bug i introduced in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
quackduck committed Nov 22, 2022
1 parent 12bf4ec commit 407341f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aces.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (bw *bitWriter) write(b byte) error {

bw.buf[byteNum] = bw.buf[byteNum] + sliceByteLen(b, bStart, left)
// bStart + left is up to where b has been read from. (bw.chunkLen+bitNum) - 8 is how many bits go to the next byte.
bw.buf[byteNum+1] = sliceByteLen(b, bStart+left, bw.chunkLen-left) << (bStart - left) // simplified 8 - (bw.chunkLen + bitNum - 8)
bw.buf[byteNum+1] = sliceByteLen(b, bStart+left, bw.chunkLen-left) << (bStart + left) // simplified 8 - (bw.chunkLen + bitNum - 8)
} else {
bw.buf[byteNum] = bw.buf[byteNum] + (b << (8 - (bitNum + bw.chunkLen)))
}
Expand Down

0 comments on commit 407341f

Please sign in to comment.