Unverified Commit 0ab2c58b authored by drmpf's avatar drmpf Committed by GitHub

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: default avatarpre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
parent 0adf7873
...@@ -105,7 +105,7 @@ bool File::seek(uint32_t pos, SeekMode mode) { ...@@ -105,7 +105,7 @@ bool File::seek(uint32_t pos, SeekMode mode) {
size_t File::position() const { size_t File::position() const {
if (!*this) { if (!*this) {
return 0; return (size_t)-1;
} }
return _p->position(); return _p->position();
......
...@@ -64,7 +64,7 @@ public: ...@@ -64,7 +64,7 @@ public:
bool seek(uint32_t pos) { bool seek(uint32_t pos) {
return seek(pos, SeekSet); return seek(pos, SeekSet);
} }
size_t position() const; size_t position() const; // returns (size_t)-1 on error
size_t size() const; size_t size() const;
bool setBufferSize(size_t size); bool setBufferSize(size_t size);
void close(); void close();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment