Merge pull request #103 from joehacksalot/master

Fixed bug fix in AutoConnectCredential when offset is >256
pull/106/head
Hieromon Ikasamo 5 years ago committed by GitHub
commit 7012d32d6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/AutoConnectCredential.cpp

@ -210,10 +210,10 @@ bool AutoConnectCredential::save(const struct station_config* config) {
}
// Seek insertion point, evaluate capacity to insert the new entry.
uint8_t eSize = strlen((const char*)config->ssid) + strlen((const char*)config->password) + sizeof(station_config::bssid) + 2;
uint16_t eSize = strlen((const char*)config->ssid) + strlen((const char*)config->password) + sizeof(station_config::bssid) + 2;
for (_dp = AC_HEADERSIZE; _dp < _containSize + AC_HEADERSIZE; _dp++) {
if (EEPROM.read(_dp) == 0xff) {
uint8_t fp = _dp;
uint16_t fp = _dp;
while (EEPROM.read(++_dp) == 0xff) {}
if (_dp - fp >= eSize) {
_dp = fp;

Loading…
Cancel
Save