Return empty string instead of "0" (#2673)
This commit is contained in:
parent
582e6433e9
commit
af23d0bb10
@ -286,7 +286,7 @@ size_t EEPROMClass::readString (int address, char* value, size_t maxLen)
|
|||||||
String EEPROMClass::readString (int address)
|
String EEPROMClass::readString (int address)
|
||||||
{
|
{
|
||||||
if (address < 0 || address > _size)
|
if (address < 0 || address > _size)
|
||||||
return String(0);
|
return String();
|
||||||
|
|
||||||
uint16_t len;
|
uint16_t len;
|
||||||
for (len = 0; len <= _size; len++)
|
for (len = 0; len <= _size; len++)
|
||||||
@ -294,7 +294,7 @@ String EEPROMClass::readString (int address)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (address + len > _size)
|
if (address + len > _size)
|
||||||
return String(0);
|
return String();
|
||||||
|
|
||||||
char value[len];
|
char value[len];
|
||||||
memcpy((uint8_t*) value, _data + address, len);
|
memcpy((uint8_t*) value, _data + address, len);
|
||||||
|
Loading…
Reference in New Issue
Block a user