tools/gen/impl_template: correct tlvs fromwire's for-loop

This commit is contained in:
darosior 2019-11-26 16:05:45 +01:00 committed by Christian Decker
parent a3961c4e06
commit 5fb8e0aade

View File

@ -269,9 +269,10 @@ bool fromwire_${tlv.name}(const u8 **cursor, size_t *max, struct ${tlv.struct_na
* encoding for `type`.
*/
field.meta = NULL;
for (size_t i = 0; i < num_types; i++)
if (types[i].type == field.numtype)
field.meta = &types[i];
for (size_t i = 0; i < num_types; i++) {
if (types[i].type == field.numtype)
field.meta = &types[i];
}
if (field.meta) {
/* Length of message can't exceed 16 bits anyway. */