[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
__errcomm__.m fix
From: |
John W. Eaton |
Subject: |
__errcomm__.m fix |
Date: |
Mon, 16 Feb 2004 11:54:11 -0600 |
On 16-Feb-2004, Teemu Ikonen <address@hidden> wrote:
| Errorplots seem to have been broken lately, attached is a little patch which
| fixes them.
|
| Teemu
| --- orig/octave/scripts/plot/__errcomm__.m
| +++ mod/octave/scripts/plot/__errcomm__.m
| @@ -58,8 +58,9 @@
| sz = size (a);
| ndata = 1;
| arg1 = a;
| - while (nargs--)
| + while (nargs)
| a = varargin{k++};
| + nargs--;
| if (isstr (a))
| fmt = a;
| cmd = "__errplot__ (arg1";
OK. I think I see the problem is that we had something like
while (nargs--)
...
while (nargs--)
which means that this could now run forever? Is there any particular
reason to decrement nargs after the "a = varargin{k++}" statement?
What about rewriting as
while (nargs-- > 0)
...
while (nargs-- > 0)
instead? Or am I missing something obvious?
jwe