X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2FReplaceInputStream.java;h=a456463b79032585a1c6372656265c4f089495c6;hp=ff2ec88ef6581f51905c4afe53c8453098e79e1a;hb=eeaa5ebc0ebe6ffd860273ed6727024737085a25;hpb=876dbf8b4e0f2498fb41f626f98e5fae46600b7b diff --git a/src/be/nikiroo/utils/ReplaceInputStream.java b/src/be/nikiroo/utils/ReplaceInputStream.java index ff2ec88..a456463 100644 --- a/src/be/nikiroo/utils/ReplaceInputStream.java +++ b/src/be/nikiroo/utils/ReplaceInputStream.java @@ -69,7 +69,7 @@ public class ReplaceInputStream extends BufferedInputStream { // Note: very simple, not efficient implementation, sorry. int count = 0; while (spos < slen && count < buffer.length - to.length) { - if (from.length > 0 && startsWith(from, source, spos)) { + if (from.length > 0 && startsWith(from, source, spos, slen)) { System.arraycopy(to, 0, buffer, spos, to.length); count += to.length; spos += from.length;