From 9968dce1f5d14094a395339fdb64e975375b06a2 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Fri, 8 Jan 2021 08:35:35 -0800 Subject: [PATCH] Invalid read return value fix Fixes #7814. Return 0, not MAXINT, when a read is called on a File without a backing instance of a SPIFFS/LittleFS/SD File. --- cores/esp8266/FS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/FS.cpp b/cores/esp8266/FS.cpp index f897a52d1d..a6199bb11f 100644 --- a/cores/esp8266/FS.cpp +++ b/cores/esp8266/FS.cpp @@ -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); }