From abd5ecedd4c97206ba1ac6000b84f09c50fa5329 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Tue, 13 Oct 2015 21:19:25 +0000 Subject: [PATCH] #1129. Fix submitted. --- include/exiv2/basicio.hpp | 8 ++++---- samples/largeiptc-test.cpp | 2 +- src/basicio.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/exiv2/basicio.hpp b/include/exiv2/basicio.hpp index a1187707..3aac9e8c 100644 --- a/include/exiv2/basicio.hpp +++ b/include/exiv2/basicio.hpp @@ -229,7 +229,7 @@ namespace Exiv2 { virtual bool isopen() const = 0; //!Returns 0 if the IO source is in a valid state, otherwise nonzero. virtual int error() const = 0; - //!Returns true if the IO position has reach the end, otherwise false. + //!Returns true if the IO position has reached the end, otherwise false. virtual bool eof() const = 0; /*! @brief Return the path to the IO resource. Often used to form @@ -512,7 +512,7 @@ namespace Exiv2 { virtual bool isopen() const; //! Returns 0 if the file is in a valid state, otherwise nonzero. virtual int error() const; - //! Returns true if the file position has reach the end, otherwise false. + //! Returns true if the file position has reached the end, otherwise false. virtual bool eof() const; //! Returns the path of the file virtual std::string path() const; @@ -721,7 +721,7 @@ namespace Exiv2 { virtual bool isopen() const; //!Always returns 0 virtual int error() const; - //!Returns true if the IO position has reach the end, otherwise false. + //!Returns true if the IO position has reached the end, otherwise false. virtual bool eof() const; //! Returns a dummy path, indicating that memory access is used virtual std::string path() const; @@ -1065,7 +1065,7 @@ namespace Exiv2 { virtual bool isopen() const; //!Always returns 0 virtual int error() const; - //!Returns true if the IO position has reach the end, otherwise false. + //!Returns true if the IO position has reached the end, otherwise false. virtual bool eof() const; //!Returns the URL of the file. virtual std::string path() const; diff --git a/samples/largeiptc-test.cpp b/samples/largeiptc-test.cpp index 88ba80b8..98d8e391 100644 --- a/samples/largeiptc-test.cpp +++ b/samples/largeiptc-test.cpp @@ -23,7 +23,7 @@ try { Exiv2::DataBuf buf(io.size()); std::cout << "Reading " << buf.size_ << " bytes from " << data << "\n"; io.read(buf.pData_, buf.size_); - if (io.error() || io.eof()) throw Exiv2::Error(14); + if (io.error() || !io.eof()) throw Exiv2::Error(14); // Read metadata from file Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(file); diff --git a/src/basicio.cpp b/src/basicio.cpp index c51a68df..1adf665a 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -1064,7 +1064,7 @@ namespace Exiv2 { bool FileIo::eof() const { assert(p_->fp_ != 0); - return feof(p_->fp_) != 0; + return feof(p_->fp_) != 0 || tell() >= size() ; } std::string FileIo::path() const