mirror of
https://github.com/esp8266/Arduino.git
synced 2025-08-01 03:47:23 +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:
committed by
GitHub
parent
98a19ab245
commit
34545a160d
@ -68,7 +68,7 @@ int File::read() {
|
|||||||
|
|
||||||
size_t File::read(uint8_t* buf, size_t size) {
|
size_t File::read(uint8_t* buf, size_t size) {
|
||||||
if (!_p)
|
if (!_p)
|
||||||
return -1;
|
return 0;
|
||||||
|
|
||||||
return _p->read(buf, size);
|
return _p->read(buf, size);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user