From 36e7d06b3934aee88e8b901e1eccbca6ba0b92d8 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sat, 3 Aug 2024 00:02:12 -0500 Subject: [PATCH] updated build system --- support/3rd_party/src/utils/file.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/support/3rd_party/src/utils/file.cpp b/support/3rd_party/src/utils/file.cpp index c8e5902c..4ac4f20d 100644 --- a/support/3rd_party/src/utils/file.cpp +++ b/support/3rd_party/src/utils/file.cpp @@ -109,10 +109,11 @@ auto file::read_(unsigned char *data, std::size_t to_read, std::uint64_t offset, static_cast(to_read)); if (total_read != nullptr) { auto after = stream_.tellg(); - if (after == -1) { + if (after >= 0) { + (*total_read) = static_cast(after - before); + } else if (after == -1 && stream_.fail()) { throw std::runtime_error("failed to tellg() after read"); } - (*total_read) = static_cast(after - before); } return true;