mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 08:12:30 +00:00
Merge pull request #1795 from kext/msos-multisz-terminator
embassy-usb: Fixed the final null terminator for RegMultiSz.
This commit is contained in:
commit
5329f234ba
@ -526,7 +526,7 @@ impl<'a> PropertyData<'a> {
|
||||
PropertyData::Binary(val) => val.len(),
|
||||
PropertyData::DwordLittleEndian(val) | PropertyData::DwordBigEndian(val) => core::mem::size_of_val(val),
|
||||
PropertyData::RegMultiSz(val) => {
|
||||
core::mem::size_of::<u16>() * val.iter().map(|x| x.encode_utf16().count() + 1).sum::<usize>() + 1
|
||||
core::mem::size_of::<u16>() * (val.iter().map(|x| x.encode_utf16().count() + 1).sum::<usize>() + 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user