From affc224aca24500565b8b0d8c90a785878695f73 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 10 Mar 2021 09:24:38 +0100 Subject: [PATCH] tape: read_tape_mam - pass correct allocation len --- src/tape/drive/mam.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tape/drive/mam.rs b/src/tape/drive/mam.rs index 4fa16c3f..54b8100e 100644 --- a/src/tape/drive/mam.rs +++ b/src/tape/drive/mam.rs @@ -101,12 +101,13 @@ lazy_static::lazy_static!{ fn read_tape_mam(file: &mut F) -> Result, Error> { - let mut sg_raw = SgRaw::new(file, 32*1024)?; + let alloc_len: u32 = 32*1024; + let mut sg_raw = SgRaw::new(file, alloc_len as usize)?; let mut cmd = Vec::new(); cmd.extend(&[0x8c, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8]); cmd.extend(&[0u8, 0u8]); // first attribute - cmd.extend(&[0u8, 0u8, 0x8f, 0xff]); // alloc len + cmd.extend(&alloc_len.to_be_bytes()); // alloc len cmd.extend(&[0u8, 0u8]); sg_raw.do_command(&cmd)