mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 13:05:25 -05:00
fix: don't change list while iteration (#434)
Co-authored-by: Dmitry Polshakov <dmitry.polshakov@dsr-corporation.com>
This commit is contained in:
@@ -56,7 +56,8 @@ namespace hex {
|
||||
std::vector<u8> File::readBytes(size_t numBytes) {
|
||||
if (!isValid()) return {};
|
||||
|
||||
std::vector<u8> bytes(numBytes ?: getSize());
|
||||
auto size = numBytes ?: getSize();
|
||||
std::vector<u8> bytes(size);
|
||||
auto bytesRead = fread(bytes.data(), 1, bytes.size(), this->m_file);
|
||||
|
||||
bytes.resize(bytesRead);
|
||||
|
||||
Reference in New Issue
Block a user