updated build system

This commit is contained in:
Scott E. Graves 2024-08-03 00:02:12 -05:00
parent b26b52fd2d
commit 36e7d06b39

View File

@ -109,10 +109,11 @@ auto file::read_(unsigned char *data, std::size_t to_read, std::uint64_t offset,
static_cast<std::streamoff>(to_read)); static_cast<std::streamoff>(to_read));
if (total_read != nullptr) { if (total_read != nullptr) {
auto after = stream_.tellg(); auto after = stream_.tellg();
if (after == -1) { if (after >= 0) {
(*total_read) = static_cast<std::size_t>(after - before);
} else if (after == -1 && stream_.fail()) {
throw std::runtime_error("failed to tellg() after read"); throw std::runtime_error("failed to tellg() after read");
} }
(*total_read) = static_cast<std::size_t>(after - before);
} }
return true; return true;