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)