Skip to content

sendtables/sendtablescs2/reader.go#L25 r.remBytes() + r.bitCount should be r.remBytes()*8 + r.bitCount #614

@yaohwang

Description

@yaohwang

Describe the bug

Code:

// remBits calculates the number of unread bits in the buffer
func (r *reader) remBits() uint32 {
	return r.remBytes() + r.bitCount
}

As r.remBytes = r.size - r.pos is the number of bytes left to read.
And r.bitCount is the number of bits left to read in the current byte.

Expected behavior

// remBits calculates the number of unread bits in the buffer
func (r *reader) remBits() uint32 {
	return r.remBytes()*8 + r.bitCount
}

If that's it I will make an pull request for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions