Commit af23d0bb authored by Bob's avatar Bob Committed by Me No Dev

Return empty string instead of "0" (#2673)

parent 582e6433
...@@ -286,7 +286,7 @@ size_t EEPROMClass::readString (int address, char* value, size_t maxLen) ...@@ -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) ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment