aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/filesystem.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-02-24 15:02:58 +0100
committerGitHub Enterprise <[email protected]>2026-02-24 15:02:58 +0100
commit2af00d3ff720969fb3b4d471778efcf8c7b3fad4 (patch)
tree9193eb3ff8cc9f3fb5e3342d94bde8c193a977ce /src/zencore/filesystem.cpp
parentadded zencore/filesystem.h include (diff)
parentVarious bug fixes (#778) (diff)
downloadzen-sb/spdlog-out.tar.xz
zen-sb/spdlog-out.zip
Merge branch 'main' into sb/spdlog-outsb/spdlog-out
Diffstat (limited to 'src/zencore/filesystem.cpp')
-rw-r--r--src/zencore/filesystem.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp
index 1a4ee4b9b..553897407 100644
--- a/src/zencore/filesystem.cpp
+++ b/src/zencore/filesystem.cpp
@@ -1326,11 +1326,6 @@ ReadFile(void* NativeHandle, void* Data, uint64_t Size, uint64_t FileOffset, uin
{
BytesRead = size_t(dwNumberOfBytesRead);
}
- else if ((BytesRead != NumberOfBytesToRead))
- {
- Ec = MakeErrorCode(ERROR_HANDLE_EOF);
- return;
- }
else
{
Ec = MakeErrorCodeFromLastError();
@@ -1344,20 +1339,15 @@ ReadFile(void* NativeHandle, void* Data, uint64_t Size, uint64_t FileOffset, uin
{
BytesRead = size_t(ReadResult);
}
- else if ((BytesRead != NumberOfBytesToRead))
- {
- Ec = MakeErrorCode(EIO);
- return;
- }
else
{
Ec = MakeErrorCodeFromLastError();
return;
}
#endif
- Size -= NumberOfBytesToRead;
- FileOffset += NumberOfBytesToRead;
- Data = reinterpret_cast<uint8_t*>(Data) + NumberOfBytesToRead;
+ Size -= BytesRead;
+ FileOffset += BytesRead;
+ Data = reinterpret_cast<uint8_t*>(Data) + BytesRead;
}
}