From 79d3aaab3f684a106b15403fd4dcafd21d802660 Mon Sep 17 00:00:00 2001 From: LE GARREC Vincent Date: Sun, 22 Oct 2023 19:18:18 +0200 Subject: [PATCH] Replace "not implemented" by assert --- src/file-reader.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/file-reader.cpp b/src/file-reader.cpp index cc058c6..5127dc3 100644 --- a/src/file-reader.cpp +++ b/src/file-reader.cpp @@ -1,3 +1,5 @@ +#include + #include #include "ntfs-common.h" @@ -55,11 +57,8 @@ std::optional> FileReader::Read(LARGE_INTEGER& addr, if (strategy_ == Strategy::FULL_CACHE) { // Not implemented. Really needed ? - if (addr.QuadPart / BUFFER_SIZE != - (addr.QuadPart + length - 1) / BUFFER_SIZE) - { - return {}; - } + assert(addr.QuadPart / BUFFER_SIZE == + (addr.QuadPart + length - 1) / BUFFER_SIZE); LARGE_INTEGER addr2{.QuadPart = addr.QuadPart - addr.QuadPart % BUFFER_SIZE}; DWORD len = SetFilePointer(handle_.get(), static_cast(addr2.LowPart),