Skip to content

Commit 4b2cfd0

Browse files
committed
fixup! [mongocxx/gridfs/bucket] Fix the cursor limit value in _open_download_stream
1 parent 575f30e commit 4b2cfd0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mongocxx/gridfs/bucket.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ downloader bucket::_open_download_stream(const client_session* session,
372372
"expected end to not be greater than the file length"};
373373
}
374374
if (file_len >= 0 && end_i64 < file_len) {
375-
const int64_t num_chunks = (end_i64 / chunk_size) - (start_i64 / chunk_size) + 1;
375+
const int64_t num_chunks = (end_i64 / static_cast<int64_t>(chunk_size)) -
376+
(start_i64 / static_cast<int64_t>(chunk_size)) + 1;
376377
chunks_options.limit(num_chunks);
377378
}
378379
}

0 commit comments

Comments
 (0)