FileStream: avoid warning about missing initialisation

FileStream::current_ is now explicitly initialized in the constructor.
Avoids reading the garbage value in case of an empty file.
This commit is contained in:
Philipp A. Hartmann 2014-02-01 18:03:52 +01:00
parent 4b32a30593
commit 16029e6b33

View File

@ -16,7 +16,7 @@ class FileStream {
public: public:
typedef char Ch; //!< Character type. Only support char. typedef char Ch; //!< Character type. Only support char.
FileStream(FILE* fp) : fp_(fp), count_(0) { Read(); } FileStream(FILE* fp) : fp_(fp), current_('\0'), count_(0) { Read(); }
char Peek() const { return current_; } char Peek() const { return current_; }
char Take() { char c = current_; Read(); return c; } char Take() { char c = current_; Read(); return c; }
size_t Tell() const { return count_; } size_t Tell() const { return count_; }