diff --git a/libraries/FS/src/FS.cpp b/libraries/FS/src/FS.cpp index 8470ce1fe55..252fc3e3944 100644 --- a/libraries/FS/src/FS.cpp +++ b/libraries/FS/src/FS.cpp @@ -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(); diff --git a/libraries/FS/src/FS.h b/libraries/FS/src/FS.h index 5f2a91761d2..6572ad987b3 100644 --- a/libraries/FS/src/FS.h +++ b/libraries/FS/src/FS.h @@ -64,7 +64,7 @@ class File : public Stream { 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();