Fix BitReader::bitsAvailable()

testing/bash_completion_debugging
Martchus 6 years ago
parent 454347c31f
commit 9429f7e23f
  1. 2
      io/bitreader.h

@ -136,7 +136,7 @@ template <typename intType> intType BitReader::showBits(byte bitCount)
*/
inline std::size_t BitReader::bitsAvailable()
{
return ((m_end - m_buffer) * 8) + m_bitsAvail;
return m_buffer != m_end ? static_cast<std::size_t>(((m_end - m_buffer - 1) * 8) + m_bitsAvail) : static_cast<std::size_t>(0);
}
/*!

Loading…
Cancel
Save