octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63462] sscanf reports incorrect number of out


From: anonymous
Subject: [Octave-bug-tracker] [bug #63462] sscanf reports incorrect number of output values.
Date: Fri, 9 Dec 2022 16:08:52 -0500 (EST)

Follow-up Comment #19, bug #63462 (project octave):

It seems that the true issue is something else. At several locations in
Octave's code, the stream state is reset and the eof bit is cleared. See
lo-utils.cc:329 for example.

            // True error.
            // Reset stream to original position, clear eof bit, pass status
on.
            is.clear ();
            is.seekg (pos);
            is.setstate (status & ~std::ios_base::eofbit);

So, whenever Octave encounters an eof condition and does not handle it
properly, the same text may be parsed again and again. As a consequence, the
last value in the string may be duplicated if the end of the string is
reached.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63462>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]