abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r560008 - /incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/XmlRestrictedCharReader.java
Date Thu, 26 Jul 2007 21:47:54 GMT
Author: jmsnell
Date: Thu Jul 26 14:47:54 2007
New Revision: 560008

URL: http://svn.apache.org/viewvc?view=rev&rev=560008
Log:
fix a bug. in certain cases, the reader would enter an endless loop.
If no chars were read, assume the stream has ended

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/XmlRestrictedCharReader.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/XmlRestrictedCharReader.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/XmlRestrictedCharReader.java?view=diff&rev=560008&r1=560007&r2=560008
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/XmlRestrictedCharReader.java
(original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/XmlRestrictedCharReader.java
Thu Jul 26 14:47:54 2007
@@ -132,7 +132,8 @@
       if (r != -1) cbuf[n] = (char)r;
       else break;
     }
-    return n - off;
+    n -= off;
+    return n <= 0 ? -1 : n;
   }
 
 }



Mime
View raw message