kms: Make sure edid model doesn't contain 0 byte
This commit is contained in:
parent
4a22724cb8
commit
ec5d89eaa9
1 changed files with 5 additions and 1 deletions
|
|
@ -203,7 +203,11 @@ pub fn edid_info(device: &impl ControlDevice, connector: connector::Handle) -> R
|
||||||
.iter()
|
.iter()
|
||||||
.find(|x| matches!(x, MonitorDescriptor::MonitorName(_)))
|
.find(|x| matches!(x, MonitorDescriptor::MonitorName(_)))
|
||||||
{
|
{
|
||||||
name.clone()
|
let mut name = name.clone();
|
||||||
|
if let Some(idx) = name.find('\0') {
|
||||||
|
name.truncate(idx);
|
||||||
|
}
|
||||||
|
name
|
||||||
} else {
|
} else {
|
||||||
format!("{}", edid.product.product_code)
|
format!("{}", edid.product.product_code)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue