Dear octave-forge developers,

the attached patch fixes biterr():

* bail if input arguments have more than two dimensions
* bail if input arguments are complex
* don't bail if input arguments are real and zero

best regards,
 Christian Neumair

-- 
Christian Neumair <cneum...@gnome.org>
--- /home/chris/pkg/octave-communications-1.0.9/inst/biterr.m	2009-05-08 15:17:56.000000000 +0200
+++ /usr/share/octave/packages/communications-1.0.6/biterr.m	2009-07-17 16:31:11.000000000 +0200
@@ -60,11 +60,16 @@ function [num, rate, ind] = biterr (a, b
   if ((nargin < 2) || (nargin > 4))
     usage ("[num rate ind] = biterr (a, b [,k [,flag]])");
   endif
+
+  if (length(size(a)) > 2 || length(size(b)) > 2)
+    error ("biterr: a and b must have at most two dimensions");
+  endif
+
   if (any(any(isinf(a))) || any(any(isnan(a))) || any(any(isinf(b))) || ...
-      any(any(isnan(b))) || !real(a) || !real(b) || ...
+      any(any(isnan(b))) || !isreal(a) || !isreal(b) || ...
       any(any((floor(a)) != a)) || any(any((floor(b)) != b)) || ...
       any(any(a < 0)) || any(any(b < 0)))
-    error ("biterr: a and b must contain only postive integers");
+    error ("biterr: a and b must contain only non-negative integers");
   endif
   
   [ar,ac] = size(a);
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to