summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Sturm <jsturm@one-point.com>2003-11-18 04:54:53 +0000
committerJeff Sturm <jsturm@one-point.com>2003-11-18 04:54:53 +0000
commit883717c461137779538cdb6dc0a80c37a3017fc9 (patch)
treeb9d308ed474829f91edde0179cba98a3a9d3612c
parentef177ff5137bf3c7245646130ffdbc1419d2b311 (diff)
downloadclasspath-883717c461137779538cdb6dc0a80c37a3017fc9.tar.gz
* java/io/ByteArrayOutputStream.java (resize): Fix off-by-one error.
-rw-r--r--ChangeLog5
-rw-r--r--java/io/ByteArrayOutputStream.java2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f8bc95c1..ad5267ea3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-11-17 Jeff Sturm <jsturm@one-point.com>
+
+ * java/io/ByteArrayOutputStream.java (resize):
+ Fix off-by-one error.
+
2003-11-17 Graydon Hoare <graydon@redhat.com>
* javax/swing/plaf/basic/BasicDefaults.java: Rewrite to spec.
diff --git a/java/io/ByteArrayOutputStream.java b/java/io/ByteArrayOutputStream.java
index 3e3e0c200..2e89cf5ee 100644
--- a/java/io/ByteArrayOutputStream.java
+++ b/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)