mirror of
https://github.com/status-im/QR-Code-generator.git
synced 2026-08-31 17:51:12 +00:00
Fixed and updated C++ code regarding integer overflow checks.
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ BitBuffer::BitBuffer()
|
||||
|
||||
|
||||
std::vector<std::uint8_t> BitBuffer::getBytes() const {
|
||||
std::vector<std::uint8_t> result((size() + 7) / 8);
|
||||
std::vector<std::uint8_t> result(size() / 8 + (size() % 8 == 0 ? 0 : 1));
|
||||
for (std::size_t i = 0; i < size(); i++)
|
||||
result[i >> 3] |= (*this)[i] ? 1 << (7 - (i & 7)) : 0;
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user