diff --git a/libraries/FS/src/FS.cpp b/libraries/FS/src/FS.cpp index 252fc3e3944..8470ce1fe55 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 (size_t)-1; + return 0; } return _p->position(); diff --git a/libraries/FS/src/FS.h b/libraries/FS/src/FS.h index 6572ad987b3..5f2a91761d2 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; // returns (size_t)-1 on error + size_t position() const; size_t size() const; bool setBufferSize(size_t size); void close();