diff libinterp/corefcn/oct-stream.cc @ 19367:a791930c3bda stable

oct-stream.cc::read: Fix calculation of nc when EOF gets hit (bug #43517) * oct-stream.cc::read: Fix nc if EOF was hit before the requested number of rows and columns were read. * io.tst: Add test for bug #43517
author Andreas Weber <andy.weber.aw@gmail.com>
date Fri, 14 Nov 2014 22:35:19 +0100
parents aa861a98d84d
children 112fc552ea22
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc	Mon Nov 03 22:07:27 2014 -0800
+++ b/libinterp/corefcn/oct-stream.cc	Fri Nov 14 22:35:19 2014 +0100
@@ -3330,6 +3330,8 @@
                 {
                   if (count % nr != 0)
                     nc = count / nr + 1;
+                  else
+                    nc = count / nr;
 
                   if (count < nr)
                     nr = count;