From 87a9433519923d77fb3ccc4b593ee323bb2c6e7f Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Thu, 28 Jun 2012 16:09:20 +0300 Subject: [PATCH] hcidump: Fix number of triplet calculation Country code is also included in the TLV size. --- tools/parser/l2cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/parser/l2cap.c b/tools/parser/l2cap.c index 8e64d6ee4..e8b7b024c 100644 --- a/tools/parser/l2cap.c +++ b/tools/parser/l2cap.c @@ -1168,7 +1168,7 @@ static void a2mp_dump_chanlist(int level, struct a2mp_tlv *tlv, char *prefix) struct a2mp_country_triplet *triplet; int i, num; - num = tlv->len / sizeof(*triplet); + num = (tlv->len - sizeof(*chan_list)) / sizeof(*triplet); printf("%s number of triplets %d\n", prefix, num); -- 2.47.3