Fix infinite loop (#346)

* Fix infinite loop

Fixed the findID function getting stuck in an infinite loop when scanning certain cards.
Loop now stops at 255.
This commit is contained in:
Mads Mogensen
2017-11-06 22:30:37 +01:00
committed by Rotzbua
parent 97ac8d389d
commit ae13b02342

View File

@@ -460,7 +460,7 @@ uint8_t findIDSLOT( byte find[] ) {
///////////////////////////////////////// Find ID From EEPROM ///////////////////////////////////
boolean findID( byte find[] ) {
uint8_t count = EEPROM.read(0); // Read the first Byte of EEPROM that
for ( uint8_t i = 1; i <= count; i++ ) { // Loop once for each EEPROM entry
for ( uint8_t i = 1; i < count; i++ ) { // Loop once for each EEPROM entry
readID(i); // Read an ID from EEPROM, it is stored in storedCard[4]
if ( checkTwo( find, storedCard ) ) { // Check to see if the storedCard read from EEPROM
return true;