Access TLV.length directly.

This commit is contained in:
2018-10-18 00:56:13 +02:00
parent 121522ced7
commit 81e69b8bea
2 changed files with 2 additions and 5 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ class Gcd:
if tlv.type_id == 0xFFFF:
# End of file reached
break
tlength = tlv.get_length()
tlength = tlv.length
payload = f.read(tlength)
tlv.set_value(payload)
if tlv.type_id == 0x0006:
@@ -57,5 +57,5 @@ class Gcd:
print("#{:03d}: {}".format(i, tlv))
else:
tlv_count += 1
tlv_length += tlv.get_length()
tlv_length += tlv.length
last_tlv = tlv.type_id