ByteArrayOutputStream.java (resize): Fix off-by-one error.
authorJeff Sturm <jsturm@one-point.com>
Sat, 8 Nov 2003 13:41:20 +0000 (13:41 +0000)
committerJeff Sturm <jsturm@gcc.gnu.org>
Sat, 8 Nov 2003 13:41:20 +0000 (13:41 +0000)
* java/io/ByteArrayOutputStream.java (resize):
Fix off-by-one error.

From-SVN: r73359

libjava/ChangeLog
libjava/java/io/ByteArrayOutputStream.java

index 6a26744..1cc97ba 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-08  Jeff Sturm  <jsturm@one-point.com>
+
+       * java/io/ByteArrayOutputStream.java (resize):
+       Fix off-by-one error.
+
 2003-11-08  Bryce McKinlay  <bryce@mckinlay.net.nz>
 
        * gnu/gcj/xlib/XAnyEvent.java (XAnyEvent): Make constructor
index 3e3e0c2..2e89cf5 100644 (file)
@@ -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)