Fixed detection of config data at the end of gcode files

This commit is contained in:
enricoturri1966 2022-04-08 09:41:26 +02:00
parent 6a67a6e21b
commit 68b6672907

View File

@ -822,8 +822,12 @@ public:
return false; return false;
m_file_pos -= m_block_len; m_file_pos -= m_block_len;
m_ifs.seekg(m_file_pos, m_ifs.beg); m_ifs.seekg(m_file_pos, m_ifs.beg);
if (! m_ifs.read(m_block.data(), m_block_len)) m_ifs.read(m_block.data(), m_block_len);
if (!m_ifs.good()) {
if (!m_ifs.eof())
return false; return false;
m_block_len = m_ifs.gcount();
}
} }
assert(m_block_len > 0); assert(m_block_len > 0);