Skip to content

Commit

Permalink
allow RegBinary to be printed with unlimited length
Browse files Browse the repository at this point in the history
  • Loading branch information
janstarke committed Jul 17, 2024
1 parent fb043af commit 6a33fba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nt_hive2"
version = "4.2.2"
version = "4.2.3"
edition = "2021"
authors = ["Jan Starke <[email protected]>", "Muteb Alqahtani <[email protected]>"]
license = "GPL-3.0"
Expand Down
6 changes: 5 additions & 1 deletion src/vk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 6a33fba

Please sign in to comment.