mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-15 19:59:34 +08:00
clear bit first in pushBit so we don't need initialized buff
This commit is contained in:
parent
cfc76098c5
commit
8ec57a7281
1 changed files with 1 additions and 0 deletions
|
@ -93,6 +93,7 @@ sample_config *getSamplingConfig() {
|
||||||
void pushBit(BitstreamOut *stream, uint8_t bit) {
|
void pushBit(BitstreamOut *stream, uint8_t bit) {
|
||||||
int bytepos = stream->position >> 3; // divide by 8
|
int bytepos = stream->position >> 3; // divide by 8
|
||||||
int bitpos = stream->position & 7;
|
int bitpos = stream->position & 7;
|
||||||
|
*(stream->buffer + bytepos) &= ~(1 << (7 - bitpos));
|
||||||
*(stream->buffer + bytepos) |= (bit > 0) << (7 - bitpos);
|
*(stream->buffer + bytepos) |= (bit > 0) << (7 - bitpos);
|
||||||
stream->position++;
|
stream->position++;
|
||||||
stream->numbits++;
|
stream->numbits++;
|
||||||
|
|
Loading…
Reference in a new issue