aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-02-26 21:27:13 +0100
committerGitHub Enterprise <[email protected]>2025-02-26 21:27:13 +0100
commitaef396302e8f9177aa9185bd37d5a8657056f73c (patch)
tree2f7997a454eedea93779876e10002aed7371ce23 /src
parentclang-format fix (diff)
downloadzen-aef396302e8f9177aa9185bd37d5a8657056f73c.tar.xz
zen-aef396302e8f9177aa9185bd37d5a8657056f73c.zip
Fix bug causing crash if large file was exact multiple of 256KB when using zen builds command (#286)
Diffstat (limited to 'src')
-rw-r--r--src/zen/cmds/builds_cmd.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp
index ececab29e..ed1eb2d19 100644
--- a/src/zen/cmds/builds_cmd.cpp
+++ b/src/zen/cmds/builds_cmd.cpp
@@ -855,7 +855,7 @@ namespace {
ZEN_ASSERT((Offset + Size) <= SourceSize);
const uint64_t BlockIndexStart = Offset / BlockSize;
- const uint64_t BlockIndexEnd = (Offset + Size) / BlockSize;
+ const uint64_t BlockIndexEnd = (Offset + Size - 1) / BlockSize;
std::vector<SharedBuffer> BufferRanges;
BufferRanges.reserve(BlockIndexEnd - BlockIndexStart + 1);