diff src/oct-stream.cc @ 4927:b7732e23965b

[project @ 2004-08-03 05:00:33 by jwe]
author jwe
date Tue, 03 Aug 2004 05:00:33 +0000
parents e80587ad9503
children 44046bbaa52c
line wrap: on
line diff
--- a/src/oct-stream.cc
+++ b/src/oct-stream.cc
@@ -1109,14 +1109,21 @@
 	  {
 	    if (c1 == '0')
 	      {
-		int c2 = is.peek ();
-
-		is.putback (c1);
+		int c2 = is.get ();
 
 		if (c2 == 'x' || c2 == 'X')
 		  is >> std::hex >> ref >> std::dec;
 		else
-		  is >> std::oct >> ref >> std::dec;
+		  {
+		    is.putback (c2);
+
+		    if (c2 == '0' || c2 == '1' || c2 == '2'
+			|| c2 == '3' || c2 == '4' || c2 == '5'
+			|| c2 == '6' || c2 == '7')
+		      is >> std::oct >> ref >> std::dec;
+		    else
+		      ref = 0;
+		  }
 	      }
 	    else
 	      {