changeset 11760:477da73a7bb8 release-3-0-x

idx-vector.cc: fix for-loop condition
author John W. Eaton <jwe@octave.org>
date Mon, 21 Apr 2008 11:48:13 -0400
parents d33d6a092064
children af3f3c6f381f
files liboctave/ChangeLog liboctave/idx-vector.cc
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-21  John W. Eaton  <jwe@octave.org>
+
+	* idx-vector.cc (IDX_VEC_REP::idx_vector_rep (const boolNDArray&)):
+	Fix for-loop condition.
+
 2008-04-16  David Bateman  <dbateman@free.fr>
 
 	* Sparse.h (Sparse<T>& operator = (Sparse<T>&)): Move definition
--- a/liboctave/idx-vector.cc
+++ b/liboctave/idx-vector.cc
@@ -307,7 +307,7 @@
 
       octave_idx_type ntot = bnda.length ();
 
-      for (octave_idx_type i = 0, k = 0; i < ntot; i++, k < len)
+      for (octave_idx_type i = 0, k = 0; i < ntot && k < len; i++)
 	if (bnda.elem (i))
 	  data[k++] = i;