sim: Match structure definition better

This padding field is defined as a u8 and a u16.  Clarify the marshaling
code to match instead of just looping over bytes.

Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
David Brown 2021-03-10 05:26:36 -07:00 committed by David Brown
parent cae9e2a85b
commit f66b2050fa
1 changed files with 2 additions and 3 deletions

View File

@ -291,9 +291,8 @@ impl ManifestGen for TlvGen {
// The dependency.
protected_tlv.push(dep.id);
for _ in 0 .. 3 {
protected_tlv.push(0);
}
protected_tlv.push(0);
protected_tlv.write_u16::<LittleEndian>(0).unwrap();
protected_tlv.push(dep.version.major);
protected_tlv.push(dep.version.minor);
protected_tlv.write_u16::<LittleEndian>(dep.version.revision).unwrap();