From f700100fd5b6dc2705462121bf60a7cd5751a785 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 1 Jan 2016 05:35:57 -0500 Subject: [PATCH] Aligned assert with subtraction that follows --- basecode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basecode.cpp b/basecode.cpp index af584046..9c6a31bc 100644 --- a/basecode.cpp +++ b/basecode.cpp @@ -57,7 +57,7 @@ size_t BaseN_Encoder::Put2(const byte *begin, size_t length, int messageEnd, boo unsigned int b = begin[m_inputPosition++], bitsLeftInSource = 8; while (true) { - assert(m_bitPos < m_bitsPerChar); + assert(m_bitsPerChar-m_bitPos >= 0); unsigned int bitsLeftInTarget = (unsigned int)(m_bitsPerChar-m_bitPos); m_outBuf[m_bytePos] |= b >> (8-bitsLeftInTarget); if (bitsLeftInSource >= bitsLeftInTarget)