diff options
author | Jeffrey Walton <noloader@gmail.com> | 2016-01-01 05:35:57 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2016-01-01 05:35:57 -0500 |
commit | f700100fd5b6dc2705462121bf60a7cd5751a785 (patch) | |
tree | d983dd8537d06ad06eb192ec9111e0d8d8ca7b05 /basecode.cpp | |
parent | e32a6c0ad691d343b4f88d45e784f1506c577a1f (diff) | |
download | cryptopp-git-f700100fd5b6dc2705462121bf60a7cd5751a785.tar.gz |
Aligned assert with subtraction that follows
Diffstat (limited to 'basecode.cpp')
-rw-r--r-- | basecode.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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)
|