fix dim check in Array<T>::delete_elements
author |
Jaroslav Hajek <highegg@gmail.com> |
date |
Sun, 02 Nov 2008 06:44:12 +0100 |
parents |
f7d44b6a74df |
children |
b11c31849b44 |
files |
liboctave/Array.cc liboctave/ChangeLog |
diffstat |
2 files changed, 3 insertions(+), 1 deletions(-)
[+]
|
line diff
--- a/liboctave/Array.cc
+++ b/liboctave/Array.cc
@@ -1352,7 +1352,7 @@
void
Array<T>::delete_elements (int dim, const idx_vector& i)
{
- if (dim > ndims ())
+ if (dim < 0 || dim >= ndims ())
{
(*current_liboctave_error_handler)
("invalid dimension in delete_elements");
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -2,6 +2,8 @@
* idx-vector.cc (idx_vector::is_complement): Set resulting extent
correctly.
+ * Array.cc (Array<T>::delete_elements (int, const idx_vector&)):
+ Fix check for invalid dim.
2008-10-31 Jaroslav Hajek <highegg@gmail.com>