Skip to content

Commit

Permalink
Invalid read return value fix
Browse files Browse the repository at this point in the history
Fixes esp8266#7814.

Return 0, not MAXINT, when a read is called on a File without a backing
instance of a SPIFFS/LittleFS/SD File.
  • Loading branch information
earlephilhower committed Jan 8, 2021
1 parent 100a8df commit 9968dce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cores/esp8266/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ int File::read() {

size_t File::read(uint8_t* buf, size_t size) {
if (!_p)
return -1;
return 0;

return _p->read(buf, size);
}
Expand Down

0 comments on commit 9968dce

Please sign in to comment.