1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-25 20:02:37 +03:00

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.
This commit is contained in:
Earle F. Philhower, III 2021-01-08 20:08:36 -08:00 committed by GitHub
parent 98a19ab245
commit 34545a160d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}