diff --git a/binary.cc b/binary.cc index 367e4e75..4953cf7e 100644 --- a/binary.cc +++ b/binary.cc @@ -489,6 +489,7 @@ bool binary_parser_t::test(std::istream& in) const read_binary_number(in) == format_version) return true; + in.clear(); in.seekg(0, std::ios::beg); return false; } diff --git a/gnucash.cc b/gnucash.cc index 49e12117..02e5b477 100644 --- a/gnucash.cc +++ b/gnucash.cc @@ -345,6 +345,7 @@ bool gnucash_parser_t::test(std::istream& in) const { char buf[5]; in.read(buf, 5); + in.clear(); in.seekg(0, std::ios::beg); return std::strncmp(buf, "