# HG changeset patch # User Markus Mützel # Date 1659458784 -7200 # Node ID bcd75c07c9e8f5cd0a0cb8364aeb3070f62debcc # Parent 5386fd4af64c4535aacfdf43cdb46fbef0217c20 scanf: Don't set error when reaching end of stream (bug #62723). * libinterp/corefcn/oct-stream.cc (base_stream::do_scanf): Don't set error when reaching end of stream. diff -r 5386fd4af64c -r bcd75c07c9e8 libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc Fri Jul 29 20:53:14 2022 -0700 +++ b/libinterp/corefcn/oct-stream.cc Tue Aug 02 18:46:24 2022 +0200 @@ -4996,7 +4996,7 @@ // If it looks like we have a matching failure, then // reset the failbit in the stream state. - if (is.rdstate () & std::ios::failbit) + if (! is.eof () && is.rdstate () & std::ios::failbit) { error (who, "format failed to match"); is.clear (is.rdstate () & (~std::ios::failbit));