Fix the computation of KEY_STATE_SIZE and the byte count to memset in BoolBytesToBits()
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
void BoolBytesToBits(uint8_t *srcBytes, uint8_t *dstBits, uint8_t byteCount)
|
||||
{
|
||||
memset(dstBits, 0, byteCount/8 + 1);
|
||||
memset(dstBits, 0, byteCount/8 + (byteCount % 8 ? 1 : 0));
|
||||
for (uint8_t i=0; i<byteCount; i++) {
|
||||
dstBits[i/8] |= !!srcBytes[i] << (i % 8);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user