mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
Revert "history_file_contents_t::create: remove constant comparison"
This reverts commit d7b4193978
.
off_t may be wider than size_t on a 32 bit system so the comparison is
justified (though the cast is not).
This commit is contained in:
parent
d7b4193978
commit
a91e1a8cab
1 changed files with 1 additions and 1 deletions
|
@ -157,7 +157,7 @@ bool history_file_contents_t::infer_file_type() {
|
|||
std::unique_ptr<history_file_contents_t> history_file_contents_t::create(int fd) {
|
||||
// Check that the file is seekable, and its size.
|
||||
off_t len = lseek(fd, 0, SEEK_END);
|
||||
if (len <= 0) return nullptr;
|
||||
if (len <= 0 || static_cast<unsigned long>(len) >= SIZE_MAX) return nullptr;
|
||||
|
||||
bool mmap_file_directly = should_mmap();
|
||||
std::unique_ptr<mmap_region_t> region =
|
||||
|
|
Loading…
Reference in a new issue