diff --git a/source/core/StarFile_windows.cpp b/source/core/StarFile_windows.cpp index d9719b1..54d6c82 100644 --- a/source/core/StarFile_windows.cpp +++ b/source/core/StarFile_windows.cpp @@ -377,12 +377,10 @@ size_t File::pread(void* f, char* data, size_t len, StreamOffset position) { HANDLE file = (HANDLE)f; DWORD numRead = 0; OVERLAPPED overlapped = makeOverlapped(position); - StreamOffset pos = ftell(f); - if (pos != 0) fseek(f, 0, IOSeek::Absolute); + fseek(f, 0, IOSeek::Absolute); int ret = ReadFile(file, data, len, &numRead, &overlapped); - if (pos != 0) fseek(f, pos, IOSeek::Absolute); - + fseek(f, pos, IOSeek::Absolute); if (ret == 0) { auto err = GetLastError(); if (err != ERROR_IO_PENDING) @@ -396,12 +394,10 @@ size_t File::pwrite(void* f, char const* data, size_t len, StreamOffset position HANDLE file = (HANDLE)f; DWORD numWritten = 0; OVERLAPPED overlapped = makeOverlapped(position); - StreamOffset pos = ftell(f); - if (pos != 0) fseek(f, 0, IOSeek::Absolute); + fseek(f, 0, IOSeek::Absolute); int ret = WriteFile(file, data, len, &numWritten, &overlapped); - if (pos != 0) fseek(f, pos, IOSeek::Absolute); - + fseek(f, pos, IOSeek::Absolute); if (ret == 0) { auto err = GetLastError(); if (err != ERROR_IO_PENDING)