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: Mon, 5 Dec 2022 15:33:23 -0500 (EST)

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

I tried to install it and also to run ./src/.libs/octave-cli but it is still
the same issue.

Then I tried to debug it and it seems that the problem happens somewhere in
oct-stream.cc:5424

      int num_values = 0;

      bool quit = false;

      for (octave_idx_type i = 0; i < len; i++)
        {
          octave_value tmp;

          quit = do_oscanf (elt, tmp, who);

          if (quit)
            break;
          else
            {
              if (tmp.is_defined ())
                retval(num_values++) = tmp;

              if (! ok ())
                break;

              elt = fmt_list.next (m_nconv > 0);
            }
        }


For whatever reason, the quit flag is not set and the code is filling the
retval array with the last value which was converted successful.



    _______________________________________________________

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]