mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-14 02:26:59 -07:00
Fixed error when no match is found for uidmapping
This commit is contained in:
parent
473124be92
commit
68033ed776
1 changed files with 6 additions and 11 deletions
|
@ -112,20 +112,15 @@ const manufactureName manufactureMapping[] = {
|
|||
// returns description of the best match
|
||||
char* getTagInfo(uint8_t uid) {
|
||||
|
||||
int i, best = -1;
|
||||
int i;
|
||||
int len = sizeof(manufactureMapping) / sizeof(manufactureName);
|
||||
|
||||
for ( i = 0; i < len; ++i ) {
|
||||
if ( uid == manufactureMapping[i].uid) {
|
||||
if (best == -1) {
|
||||
best = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
for ( i = 0; i < len; ++i )
|
||||
if ( uid == manufactureMapping[i].uid)
|
||||
return manufactureMapping[i].desc;
|
||||
|
||||
if (best>=0) return manufactureMapping[best].desc;
|
||||
|
||||
return manufactureMapping[i].desc;
|
||||
//No match, return default
|
||||
return manufactureMapping[len-1].desc;
|
||||
}
|
||||
|
||||
int CmdHF14AList(const char *Cmd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue