- Fix potential bug in config read and write after 10 iterations through the for loop
This commit is contained in:
ZanzyTHEbar 2022-09-13 17:24:56 +01:00
parent 9b965c224b
commit 3c1f3312e7

View File

@ -74,6 +74,11 @@ void ProjectConfig::wifiConfigSave()
putString(ssid.c_str(), this->config.networks[i].ssid.c_str());
putString(password.c_str(), this->config.networks[i].password.c_str());
putInt(channel.c_str(), this->config.networks[i].channel);
name = "name";
ssid = "ssid";
password = "pass";
channel = "channel";
}
/* AP Config */
@ -145,6 +150,11 @@ void ProjectConfig::load()
const std::string &temp_3 = getString(password.c_str()).c_str();
uint8_t temp_4 = getUInt(channel.c_str());
name = "name";
ssid = "ssid";
password = "pass";
channel = "channel";
//! push_back creates a copy of the object, so we need to use emplace_back
this->config.networks.emplace_back(
temp_1,