diff --git a/Cargo.toml b/Cargo.toml index e80feb5..89c1756 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nt_hive2" -version = "4.2.2" +version = "4.2.3" edition = "2021" authors = ["Jan Starke ", "Muteb Alqahtani "] license = "GPL-3.0" diff --git a/src/vk.rs b/src/vk.rs index bf36c69..8b44983 100644 --- a/src/vk.rs +++ b/src/vk.rs @@ -281,7 +281,11 @@ impl Display for RegistryValue { RegistryValue::RegSZ(val) => write!(f, "{val:?}"), RegistryValue::RegExpandSZ(val) => write!(f, "{val:?}"), RegistryValue::RegBinary(val) => { - write!(f, "{:?}", if val.len() > 16 { &val[..16] } else { val }) + if let Some(width) = f.width() { + write!(f, "{:?}", if val.len() > width { &val[..width] } else { val }) + } else { + write!(f, "{val:?}") + } } RegistryValue::RegDWord(val) => write!(f, "0x{:08x}", val), RegistryValue::RegDWordBigEndian(val) => write!(f, "0x{:08x}", val),