papi: use correct size for fixed length strings

This is required for correct packing of unions.

Type: fix
Change-Id: I92d04b1bbcb3fc3fe06474d8f2c59ed3502e6bd6
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
This commit is contained in:
Klement Sekera
2024-03-12 18:41:04 +01:00
committed by Ole Tr�an
parent ceed1e3b81
commit e45fac02fd

View File

@ -135,7 +135,7 @@ class String(Packer):
def __init__(self, name, num, options):
self.name = name
self.num = num
self.size = 1
self.size = num if num else 1
self.length_field_packer = BaseTypes("u32")
self.limit = options["limit"] if "limit" in options else num
self.fixed = True if num else False