EEPROM.readstring was returning an extra character (#1609)

This commit is contained in:
lbernstone 2018-07-07 01:19:44 -07:00 committed by Me No Dev
parent 9efecc1be0
commit 9f6d0d2958

View File

@ -296,9 +296,9 @@ String EEPROMClass::readString (int address)
if (address + len > _size) if (address + len > _size)
return String(0); return String(0);
char value[len + 1]; char value[len];
memcpy((uint8_t*) value, _data + address, len); memcpy((uint8_t*) value, _data + address, len);
value[len + 1] = 0; value[len] = 0;
return String(value); return String(value);
} }