APE: Fix inconsistent error message

This commit is contained in:
Serial 2022-04-08 22:09:13 -04:00
parent f1f2a5c5dc
commit 6ac0fe8f54
No known key found for this signature in database
GPG key ID: DA95198DC17C4568

View file

@ -51,8 +51,7 @@ where
}
let read_only = (flags & 1) == 1;
let item_type = (flags & 6) >> 1;
let item_type = (flags >> 1) & 3;
let mut value = try_vec![0; value_size as usize];
data.read_exact(&mut value)?;
@ -61,7 +60,7 @@ where
0 => ItemValue::Text(String::from_utf8(value).map_err(|_| {
FileDecodingError::new(
FileType::APE,
"Expected a string value based on flags, found binary data",
"Failed to convert text item into a UTF-8 string",
)
})?),
1 => ItemValue::Binary(value),