Author: nextgens
Date: 2008-08-17 18:38:15 +0000 (Sun, 17 Aug 2008)
New Revision: 21979

Modified:
   trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
Log:
even better this way!

Modified: trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
===================================================================
--- trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
2008-08-17 18:35:16 UTC (rev 21978)
+++ trunk/freenet/src/freenet/support/io/LineReadingInputStream.java    
2008-08-17 18:38:15 UTC (rev 21979)
@@ -42,7 +42,8 @@
                                return new String(buf, 0, ctr, utf ? "UTF-8" : 
"ISO-8859-1");
                        }
                        // REDFLAG this is definitely safe with the above 
charsets, it may not be safe with some wierd ones. 
-                       for(; ctr < buf.length; ctr++) {
+                       int end = ctr + x;
+                       for(; ctr < end; ctr++) {
                                if(buf[ctr] == '\n') {
                                        String toReturn = "";
                                        if(ctr != 0) {


Reply via email to