octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in printf in 2.1.31?


From: John W. Eaton
Subject: bug in printf in 2.1.31?
Date: Thu, 3 Aug 2000 00:11:42 -0500 (CDT)

On  3-Aug-2000, Joao Cardoso <address@hidden> wrote:

| I'm not sure if this is 2.1.31 bug...
| 
| octave:1> printf("--%d--\n",[]);
| --0--
| octave:2> printf("%d\n");
| 0
| octave:3> printf("%d")
| 0ans = 1
| 
| is it? humm, I think it is.

I think it's a bug.  Please try the following patch (also checked in
to the CVS archive now, so it should show up in the anonymous CVS
archive shortly).

Thanks,

jwe

2000-08-03  John W. Eaton  <address@hidden>

        * oct-stream.cc (printf_value_cache::double_value): Also set
        curr_stat to conversion_error if there are no values at all.


Index: oct-stream.cc
===================================================================
RCS file: /usr/local/cvsroot/octave/src/oct-stream.cc,v
retrieving revision 1.66
diff -u -r1.66 oct-stream.cc
--- oct-stream.cc       2000/07/20 19:21:24     1.66
+++ oct-stream.cc       2000/08/03 05:08:37
@@ -2037,7 +2037,10 @@
 {
   double retval = 0.0;
 
-  while (val_idx < n_vals)
+  if (exhausted ())
+    curr_state = conversion_error;
+
+  while (! exhausted ())
     {
       if (! data)
        {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]