Skip to content

Commit

Permalink
Review remark from RadWolfie
Browse files Browse the repository at this point in the history
  • Loading branch information
ergo720 committed Aug 21, 2024
1 parent cf2ae5c commit 1689004
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/hw/eeprom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@ eeprom::init(std::filesystem::path eeprom_dir)
m_fs = std::move(*opt);
m_fs.seekg(0);
m_fs.write((const char *)g_default_eeprom, 256);
if (m_fs.good()) {
std::memcpy(m_eeprom, g_default_eeprom, 256);
return true;
if (!m_fs.good()) {
logger_en(error, "Failed to update eeprom file");
return false;
}
logger_en(error, "Failed to update eeprom file");
return false;
std::memcpy(m_eeprom, g_default_eeprom, 256);
return true;
}
}
else {
Expand All @@ -118,10 +118,10 @@ eeprom::init(std::filesystem::path eeprom_dir)
m_fs = std::move(*opt);
m_fs.seekg(0);
m_fs.read((char *)m_eeprom, 256);
if (m_fs.good()) {
return true;
if (!m_fs.good()) {
logger_en(error, "Failed to copy eeprom file to memory");
return false;
}
logger_en(error, "Failed to copy eeprom file to memory");
return false;
return true;
}
}

0 comments on commit 1689004

Please sign in to comment.