diff options
author | Jeff Sturm <jsturm@one-point.com> | 2003-11-18 04:54:53 +0000 |
---|---|---|
committer | Jeff Sturm <jsturm@one-point.com> | 2003-11-18 04:54:53 +0000 |
commit | 883717c461137779538cdb6dc0a80c37a3017fc9 (patch) | |
tree | b9d308ed474829f91edde0179cba98a3a9d3612c | |
parent | ef177ff5137bf3c7245646130ffdbc1419d2b311 (diff) | |
download | classpath-883717c461137779538cdb6dc0a80c37a3017fc9.tar.gz |
* java/io/ByteArrayOutputStream.java (resize): Fix off-by-one error.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | java/io/ByteArrayOutputStream.java | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -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) |