diff --git a/src/bin/hexyl.rs b/src/bin/hexyl.rs index 10c411a..e85ac59 100644 --- a/src/bin/hexyl.rs +++ b/src/bin/hexyl.rs @@ -163,7 +163,11 @@ fn main() { fn parse_hex_or_int(n: &str) -> Option { if n.starts_with("0x") { - u64::from_str_radix(n.trim_start_matches("0x"), 16).ok() + let n = n.trim_start_matches("0x"); + if n.chars().next() == Some('+') { + return None; + } + u64::from_str_radix(n, 16).ok() } else { n.parse::().ok() }