X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/378d3406cae2ab5d6f8c43fd933134d5395c4ddb..77499f6fb24f42fdcd20e37659e80adf94641077:/client/emv/tlv.c diff --git a/client/emv/tlv.c b/client/emv/tlv.c index d78f049e..24125cc7 100644 --- a/client/emv/tlv.c +++ b/client/emv/tlv.c @@ -308,7 +308,7 @@ void tlvdb_add(struct tlvdb *tlvdb, struct tlvdb *other) tlvdb->next = other; } -void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data) +void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data, int level) { struct tlvdb *next = NULL; @@ -317,8 +317,9 @@ void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data) for (; tlvdb; tlvdb = next) { next = tlvdb->next; - cb(data, &tlvdb->tag); - tlvdb_visit(tlvdb->children, cb, data); + bool is_leaf = (tlvdb->children == NULL); + cb(data, &tlvdb->tag, level, is_leaf); + tlvdb_visit(tlvdb->children, cb, data, level+1); } }