1
0
mirror of synced 2025-02-17 18:59:21 +01:00

fix: Infinite loop when exporting selection to file

This commit is contained in:
WerWolv 2024-03-14 17:52:41 +01:00
parent 88756c83c7
commit 246ed15d6d

View File

@ -198,7 +198,7 @@ namespace hex::plugin::builtin {
std::vector<u8> bytes(5_MiB);
auto selection = ImHexApi::HexEditor::getSelection();
for (u64 address = selection->getStartAddress(); address <= selection->getEndAddress(); address += bytes.size()) {
for (u64 address = selection->getStartAddress(); address < selection->getEndAddress(); address += bytes.size()) {
bytes.resize(std::min<u64>(bytes.size(), selection->getEndAddress() - address));
provider->read(address, bytes.data(), bytes.size());