Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/ntfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Finck <colin@reactos.org>2021-05-05 08:14:06 +0300
committerColin Finck <colin@reactos.org>2021-05-05 08:14:06 +0300
commit8ff664400cf226ffc778b19fc42c2c4c5eaea6ae (patch)
tree8cff23bd24cb5fe487d8107756a8208ff6e4b4c0 /src/structured_values/index_root.rs
parent0402611794e8d86814e25eba8515d00e1685ce4b (diff)
Implement `NtfsAttributeValue::len` and use it for the structured values
Diffstat (limited to 'src/structured_values/index_root.rs')
-rw-r--r--src/structured_values/index_root.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/structured_values/index_root.rs b/src/structured_values/index_root.rs
index a8c1d44..14873e2 100644
--- a/src/structured_values/index_root.rs
+++ b/src/structured_values/index_root.rs
@@ -37,17 +37,16 @@ impl NtfsIndexRoot {
pub(crate) fn new<T>(
attribute_position: u64,
mut value_attached: NtfsAttributeValueAttached<'_, '_, T>,
- value_length: u64,
) -> Result<Self>
where
T: Read + Seek,
{
- if value_length < INDEX_ROOT_HEADER_SIZE {
+ if value_attached.len() < INDEX_ROOT_HEADER_SIZE {
return Err(NtfsError::InvalidAttributeSize {
position: attribute_position,
ty: NtfsAttributeType::IndexRoot,
expected: INDEX_ROOT_HEADER_SIZE,
- actual: value_length,
+ actual: value_attached.len(),
});
}