Mercurial > hg > octave-terminal
changeset 4255:f7d11c1a49e3
[project @ 2002-12-31 20:16:38 by jwe]
author | jwe |
---|---|
date | Tue, 31 Dec 2002 20:16:38 +0000 |
parents | df5f2e433a11 |
children | 2b9c6dc25449 |
files | src/ChangeLog src/pt-arg-list.cc |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2002-12-31 John W. Eaton <jwe@bevo.che.wisc.edu> + * pt-arg-list.cc (F__end__): Fail if rows or columns is negative. + * syscalls.cc (Fmkfifo): Use long_value instead of cast. * ov.h (octave_value::short_value, octave_value::ushort_value,
--- a/src/pt-arg-list.cc +++ b/src/pt-arg-list.cc @@ -104,7 +104,15 @@ { case -1: // XXX FIXME XXX -- we really want "numel" here. - retval = indexed_object->rows () * indexed_object->columns (); + { + int nr = indexed_object->rows (); + int nc = indexed_object->columns (); + + if (nr < 0 || nc < 0) + ::error ("invalid use of end"); + else + retval = nr * nc; + } break; case 0: