From 7039afba0164b1b9cd531f33ae34f0e6bcfe49d8 Mon Sep 17 00:00:00 2001 From: yfblock <321353225@qq.com> Date: Fri, 3 Mar 2023 17:38:57 +0800 Subject: [PATCH] fix hexdump print --- user/src/bin/tcp_simplehttp.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/user/src/bin/tcp_simplehttp.rs b/user/src/bin/tcp_simplehttp.rs index 48030545..04fa79c6 100644 --- a/user/src/bin/tcp_simplehttp.rs +++ b/user/src/bin/tcp_simplehttp.rs @@ -157,9 +157,8 @@ pub fn main() -> i32 { #[allow(unused)] pub fn hexdump(data: &[u8]) { const PRELAND_WIDTH: usize = 70; - println!("[kernel] {:-^1$}", " hexdump ", PRELAND_WIDTH); + println!("{:-^1$}", " hexdump ", PRELAND_WIDTH); for offset in (0..data.len()).step_by(16) { - print!("[kernel] "); for i in 0..16 { if offset + i < data.len() { print!("{:02x} ", data[offset + i]); @@ -185,5 +184,5 @@ pub fn hexdump(data: &[u8]) { println!(""); } - println!("[kernel] {:-^1$}", " hexdump end ", PRELAND_WIDTH); + println!("{:-^1$}", " hexdump end ", PRELAND_WIDTH); }