tape: read_tape_mam - pass correct allocation len

This commit is contained in:
Dietmar Maurer 2021-03-10 09:24:38 +01:00
parent 6f82d32977
commit affc224aca

View File

@ -101,12 +101,13 @@ lazy_static::lazy_static!{
fn read_tape_mam<F: AsRawFd>(file: &mut F) -> Result<Vec<u8>, 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)