Skip to content
Snippets Groups Projects
Commit 61b13484 authored by T.Hideshima's avatar T.Hideshima
Browse files

[debug] use istream::peek() != EOF to check eof of option-file

Because std::istream::operator bool() returns false AFTER FAILING get(),
the function `importOptions` read the final character TWICE.
Giving empty file for `--options=...` told me this error.

In this commit, `std::istream::peek()` is used instead. This member
function returns the next character without proceeding the file pointer,
which you can compare to EOF without any side-effects.
parent 9c413bdd
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment