summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/hash.cpp
diff options
context:
space:
mode:
author Vas Crabb <cuavas@users.noreply.github.com>2024-02-25 02:27:26 +1100
committer GitHub <noreply@github.com>2024-02-25 02:27:26 +1100
commit1615b8551a3a73532ac234973cfb04dd8ed98ba4 (patch)
tree25575506b4117afa614b94b4370af7f16eb9dbb5 /src/lib/util/hash.cpp
parent334ec12e0043ef939be418283235e3dbe5a005fe (diff)
util/ioprocs.cpp: Added wrappers for common patterns. (#11608)
emu/diimage.h: Removed fread overloads that allocate memory for output. util/core_file.cpp: Changed output size of load to size_t.
Diffstat (limited to 'src/lib/util/hash.cpp')
-rw-r--r--src/lib/util/hash.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/util/hash.cpp b/src/lib/util/hash.cpp
index 9100ff6abde..f2c528e9b22 100644
--- a/src/lib/util/hash.cpp
+++ b/src/lib/util/hash.cpp
@@ -410,14 +410,13 @@ std::error_condition hash_collection::compute(random_read &stream, uint64_t offs
unsigned const chunk_length = std::min(length, sizeof(buffer));
// read one chunk
- std::size_t bytes_read;
- std::error_condition err = stream.read_at(offset, buffer, chunk_length, bytes_read);
+ auto const [err, bytes_read] = read_at(stream, offset, buffer, chunk_length);
if (err)
return err;
if (!bytes_read) // EOF?
break;
offset += bytes_read;
- length -= chunk_length;
+ length -= bytes_read;
// append the chunk
creator->append(buffer, bytes_read);