Maybe fix handling of 7byte and 10byte uid cards

This commit is contained in:
Arti Zirk 2016-12-21 01:56:22 +02:00
parent 0f5a58fa50
commit bad2fd2876

View File

@ -42,8 +42,8 @@ card_t* rfid_find_card(const card_t *card)
card_t *current;
current = head;
while (current != NULL) {
if ((current->uid_size != card->uid_size) ||
!memcmp(current->uid, card->uid, current->uid_size) ||
if (((current->uid_size == card->uid_size) &&
!memcmp(current->uid, card->uid, current->uid_size)) ||
((card->user != NULL) && !strcmp(current->user, card->user))) {
return current;