]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
Fixed error when no match is found for uidmapping
authorMartin Holst Swende <martin@swende.se>
Sun, 11 Jan 2015 20:49:13 +0000 (21:49 +0100)
committerMartin Holst Swende <martin@swende.se>
Sun, 11 Jan 2015 20:49:13 +0000 (21:49 +0100)
client/cmdhf14a.c

index 53ab240c7da36b9e75f0453f71d22271f24f8784..01602d76a154414b8ad2e70365b49b37c7fa3247 100644 (file)
@@ -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)
Impressum, Datenschutz