Skip to content

Commit 34545a1

Browse files
Invalid read return value fix (#7817)
Fixes #7814. Return 0, not MAXINT, when a read is called on a File without a backing instance of a SPIFFS/LittleFS/SD File.
1 parent 98a19ab commit 34545a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/esp8266/FS.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int File::read() {
6868

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

7373
return _p->read(buf, size);
7474
}

0 commit comments

Comments
 (0)