From: Martin Holst Swende Date: Sun, 11 Jan 2015 20:49:13 +0000 (+0100) Subject: Fixed error when no match is found for uidmapping X-Git-Tag: v2.0.0-rc1~52^2^2~2 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/68033ed776a77b11e831569c93af82fe8b043dc8?hp=473124be92f5108df63146ef8b6be2a1db30b87a Fixed error when no match is found for uidmapping --- diff --git a/client/cmdhf14a.c b/client/cmdhf14a.c index 53ab240c..01602d76 100644 --- a/client/cmdhf14a.c +++ b/client/cmdhf14a.c @@ -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)