# HG changeset patch # User pantxo # Date 1402934631 25200 # Node ID 7bf70dc7f06c7eb11c5fafdfd97b501cd56e5e78 # Parent 94d791a0373727c0501c87a952d144ff94b5020c Correctly return 0 for empty matrices (bug #42563). * xnorm.cc (xnorm): Add check for empty matrix and return 0 if found. diff -r 94d791a03737 -r 7bf70dc7f06c libinterp/corefcn/xnorm.cc --- a/libinterp/corefcn/xnorm.cc Mon Jun 16 08:55:17 2014 -0700 +++ b/libinterp/corefcn/xnorm.cc Mon Jun 16 09:03:51 2014 -0700 @@ -48,7 +48,9 @@ if (isfloat || x.is_double_type ()) { - if (isvector) + if (x.is_empty ()) + retval = octave_value (0); + else if (isvector) { if (isfloat & iscomplex) retval = xnorm (x.float_complex_column_vector_value (),