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

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

[Octave-bug-tracker] [bug #43613] fread() with a vector size doesn't ret


From: Andreas Weber
Subject: [Octave-bug-tracker] [bug #43613] fread() with a vector size doesn't return a shortened matrix when it hits EOF
Date: Fri, 14 Nov 2014 20:52:42 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.2.0

Update of bug #43613 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #1:

I can confirm this behavior on the stable and default branch.

The problem is in oct-stream.cc around line 3451:
http://hg.savannah.gnu.org/hgweb/octave/file/8ba8f3d22189/libinterp/corefcn/oct-stream.cc#l3451


else if (count != nr * nc)
  {
    if (count % nr != 0)
      nc = count / nr + 1;

    if (count < nr)
      nr = count;
  }


which should be

  if (count % nr != 0)
    nc = count / nr + 1;
  else
    nc = count / nr;

  if (count < nr)
    nr = count;


to my understanding. If someone can confirm that Matlab behaves the way
described below, I'll prepare a patch and test for this issue.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43613>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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