From 8607716cb8c954e2a335cf375da79bb30e4dc01a Mon Sep 17 00:00:00 2001 From: Intege-rs Date: Sat, 13 Sep 2025 22:29:42 -0400 Subject: [PATCH] fix hex dump from ending one byte early --- sub/xpat/src/hexdump.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sub/xpat/src/hexdump.rs b/sub/xpat/src/hexdump.rs index ec6e539..9b3263f 100644 --- a/sub/xpat/src/hexdump.rs +++ b/sub/xpat/src/hexdump.rs @@ -56,9 +56,8 @@ impl<'s, T: Scannable + ?Sized, R: RangeBounds> Display for HexDump<'s, T for (mut addr, chunk) in ChunkIter::new(self.0, start) { for chunk in chunk.chunks(16) { - if addr >= end { return Ok(()) } - - let chunk = &chunk[..(end - addr).min(chunk.len())]; + if addr > end { return Ok(()) } + let chunk = &chunk[..(1 + end - addr).min(chunk.len())]; //╶───╴Column╶────────────────────────────────╴