X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/4cdd63b245e34b42df42b384009838020d8fad02..b8dd1ef6490a49784c797e9312df8622445e28dd:/client/emv/tlv.c diff --git a/client/emv/tlv.c b/client/emv/tlv.c index 9722c931..5472c47a 100644 --- a/client/emv/tlv.c +++ b/client/emv/tlv.c @@ -352,7 +352,13 @@ struct tlvdb *tlvdb_find_path(struct tlvdb *tlvdb, tlv_tag_t tag[]) { void tlvdb_add(struct tlvdb *tlvdb, struct tlvdb *other) { + if (tlvdb == other) + return; + while (tlvdb->next) { + if (tlvdb->next == other) + return; + tlvdb = tlvdb->next; } @@ -582,3 +588,9 @@ bool tlv_get_int(const struct tlv *etlv, int *value) } return false; } + +bool tlvdb_get_uint8(struct tlvdb *tlvRoot, tlv_tag_t tag, uint8_t *value) +{ + const struct tlv *tlvelm = tlvdb_get(tlvRoot, tag, NULL); + return tlv_get_uint8(tlvelm, value); +}