Commit 16029e6b authored by Philipp A. Hartmann's avatar Philipp A. Hartmann

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.
parent 4b32a305
......@@ -16,7 +16,7 @@ class FileStream {
public:
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 Take() { char c = current_; Read(); return c; }
size_t Tell() const { return count_; }
......
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