From b7de519e475dfe87c715921ee39a0ea53f382550 Mon Sep 17 00:00:00 2001 From: pjht Date: Sat, 28 Jan 2023 08:20:02 -0600 Subject: [PATCH] Fix the ROM's reload command --- src/rom.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rom.rs b/src/rom.rs index b65bbd4..9a7f3fe 100644 --- a/src/rom.rs +++ b/src/rom.rs @@ -114,11 +114,11 @@ impl Card for Rom { println!("Read ROM image file {}", cmd[1]); } else if cmd[0] == "reload" { if let Some(file_name) = &self.file_name { - let mut file = File::open(cmd[1]) - .map_err(|e| anyhow!("Couldn't open ROM image file {} ({})", cmd[1], e))?; + let mut file = File::open(file_name) + .map_err(|e| anyhow!("Couldn't open ROM image file {} ({})", file_name, e))?; self.data.clear(); file.read_to_end(&mut self.data) - .map_err(|e| anyhow!("Failed to read ROM image file {} ({})", cmd[1], e))?; + .map_err(|e| anyhow!("Failed to read ROM image file {} ({})", file_name, e))?; println!("Reloaded ROM image file {}", file_name); } else { println!("No ROM image file to reload");