fix: Backwards searching being broken

Fixes #713
This commit is contained in:
WerWolv
2022-09-03 23:02:46 +02:00
parent 4df1496a0f
commit 7f6aa9f9a6
2 changed files with 45 additions and 15 deletions

View File

@@ -218,7 +218,7 @@ namespace hex::prv {
}
value_type operator[](i64 offset) const {
auto result = this->m_reader->readReverse(this->m_address + offset, 1);
auto result = this->m_reader->readReverse(this->m_address - offset, 1);
if (result.empty())
return 0x00;
@@ -250,7 +250,7 @@ namespace hex::prv {
}
ReverseIterator rend() {
return { this, std::numeric_limits<u64>::max() };
return { this, 0 };
}
private: