mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fix: shifting signed 32-bit value by 31 bits is undefined behaviour
This commit is contained in:
parent
4aeff95259
commit
d9308d912d
4 changed files with 7 additions and 7 deletions
|
@ -317,7 +317,7 @@ void ReadTItag(void) {
|
|||
// expected for either the low or high frequency
|
||||
if ((samples > (sampleslo - threshold)) && (samples < (sampleslo + threshold))) {
|
||||
// low frequency represents a 1
|
||||
shift3 |= (1 << 31);
|
||||
shift3 |= (1u << 31);
|
||||
} else if ((samples > (sampleshi - threshold)) && (samples < (sampleshi + threshold))) {
|
||||
// high frequency represents a 0
|
||||
} else {
|
||||
|
@ -481,7 +481,7 @@ void AcquireTiType(void) {
|
|||
// unpack buffer
|
||||
for (i = TIBUFLEN - 1; i >= 0; i--) {
|
||||
for (j = 0; j < 32; j++) {
|
||||
if (buf[i] & (1 << j)) {
|
||||
if (buf[i] & (1u << j)) {
|
||||
dest[--n] = 1;
|
||||
} else {
|
||||
dest[--n] = -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue