From fe79b0e411b70540ed341a0e394f7b7cb9a434c4 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Wed, 20 Feb 2019 18:36:01 +0200 Subject: [PATCH] remove duplicates in tlv.h and add get_uint_8 --- client/emv/tlv.c | 6 ++++++ client/emv/tlv.h | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/emv/tlv.c b/client/emv/tlv.c index 9722c931..17bae3ed 100644 --- a/client/emv/tlv.c +++ b/client/emv/tlv.c @@ -582,3 +582,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); +} diff --git a/client/emv/tlv.h b/client/emv/tlv.h index 80f6b74f..54900f41 100644 --- a/client/emv/tlv.h +++ b/client/emv/tlv.h @@ -65,7 +65,6 @@ bool tlv_equal(const struct tlv *a, const struct tlv *b); bool tlv_get_uint8(const struct tlv *etlv, uint8_t *value); bool tlv_get_int(const struct tlv *etlv, int *value); -bool tlv_get_uint8(const struct tlv *etlv, uint8_t *value); -bool tlv_get_int(const struct tlv *etlv, int *value); +bool tlvdb_get_uint8(struct tlvdb *tlvRoot, tlv_tag_t tag, uint8_t *value); #endif