EEPROM.readstring was returning an extra character (#1609)
This commit is contained in:
parent
9efecc1be0
commit
9f6d0d2958
@ -296,9 +296,9 @@ String EEPROMClass::readString (int address)
|
||||
if (address + len > _size)
|
||||
return String(0);
|
||||
|
||||
char value[len + 1];
|
||||
char value[len];
|
||||
memcpy((uint8_t*) value, _data + address, len);
|
||||
value[len + 1] = 0;
|
||||
value[len] = 0;
|
||||
return String(value);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user