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::Binary(val) => val.len(),
|
||||||
PropertyData::DwordLittleEndian(val) | PropertyData::DwordBigEndian(val) => core::mem::size_of_val(val),
|
PropertyData::DwordLittleEndian(val) | PropertyData::DwordBigEndian(val) => core::mem::size_of_val(val),
|
||||||
PropertyData::RegMultiSz(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