diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 6a26744d2e15..1cc97bad6f6c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2003-11-08 Jeff Sturm + + * java/io/ByteArrayOutputStream.java (resize): + Fix off-by-one error. + 2003-11-08 Bryce McKinlay * gnu/gcj/xlib/XAnyEvent.java (XAnyEvent): Make constructor diff --git a/libjava/java/io/ByteArrayOutputStream.java b/libjava/java/io/ByteArrayOutputStream.java index 3e3e0c200181..2e89cf5ee0a9 100644 --- a/libjava/java/io/ByteArrayOutputStream.java +++ b/libjava/java/io/ByteArrayOutputStream.java @@ -198,7 +198,7 @@ public class ByteArrayOutputStream extends OutputStream // Resize buffer to accommodate new bytes. private void resize (int add) { - if (count + add >= buf.length) + if (count + add > buf.length) { int newlen = buf.length * 2; if (count + add > newlen)