Skip to content

Commit

Permalink
Return empty string instead of "0" (#2673)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bmooij authored and me-no-dev committed Apr 15, 2019
1 parent 582e643 commit af23d0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/EEPROM/src/EEPROM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,15 @@ size_t EEPROMClass::readString (int address, char* value, size_t maxLen)
String EEPROMClass::readString (int address)
{
if (address < 0 || address > _size)
return String(0);
return String();

uint16_t len;
for (len = 0; len <= _size; len++)
if (_data[address + len] == 0)
break;

if (address + len > _size)
return String(0);
return String();

char value[len];
memcpy((uint8_t*) value, _data + address, len);
Expand Down

0 comments on commit af23d0b

Please sign in to comment.