FS library position() to return (size_t) -1 on error (#10002)

* position_fix

Fix for error return from position()
Issue #9992

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
drmpf 2024-07-10 20:50:09 +10:00 committed by GitHub
parent 0adf7873d1
commit 0ab2c58b6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -105,7 +105,7 @@ bool File::seek(uint32_t pos, SeekMode mode) {
size_t File::position() const {
if (!*this) {
return 0;
return (size_t)-1;
}
return _p->position();

View file

@ -64,7 +64,7 @@ public:
bool seek(uint32_t pos) {
return seek(pos, SeekSet);
}
size_t position() const;
size_t position() const; // returns (size_t)-1 on error
size_t size() const;
bool setBufferSize(size_t size);
void close();