summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/util/encode/base_n.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/util/encode/base_n.cc b/src/lib/util/encode/base_n.cc
index f37ebfc3e6..461ca0a68d 100644
--- a/src/lib/util/encode/base_n.cc
+++ b/src/lib/util/encode/base_n.cc
@@ -378,7 +378,7 @@ BaseNTransformer<BitsPerChunk, BaseZeroCode, Encoder, Decoder>::decode(
// Number of bits of the conversion result including padding must be
// a multiple of 8; otherwise the decoder reaches the end of input
// with some incomplete bits of data, which is invalid.
- if (((char_count * BitsPerChunk) & 7) != 0) {
+ if (((char_count * BitsPerChunk) % 8) != 0) {
throw IncompleteBaseInput(); // catch this immediately below
}
} catch (const IncompleteBaseInput&) {