Closed
Description
Board
All
Device Description
ESP32
ESP8266 code base has the same issue
Hardware Configuration
all
Version
latest master (checkout manually)
IDE Name
Arduino
Operating System
Windows 10
Flash frequency
40Mhz
PSRAM enabled
yes
Upload speed
115200
Description
Current code returns valid file position on error, should return invalid position, i.e. -1
Current code is
size_t File::position() const {
if (!*this) {
return 0;
}
return _p->position();
}
should be
size_t File::position() const {
if (!*this) {
return -1; // <<<<<<<<<<<<<<<<
}
return _p->position();
}
Sketch
Not needed
Debug Message
None
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.