summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/java/io/InputStream.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/io/InputStream.java')
-rw-r--r--libjava/classpath/java/io/InputStream.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/libjava/classpath/java/io/InputStream.java b/libjava/classpath/java/io/InputStream.java
index 86d1cd74914..e56197a837e 100644
--- a/libjava/classpath/java/io/InputStream.java
+++ b/libjava/classpath/java/io/InputStream.java
@@ -193,10 +193,8 @@ public abstract class InputStream
*/
public int read(byte[] b, int off, int len) throws IOException
{
- if (off < 0 || len < 0 || off + len > b.length)
+ if (off < 0 || len < 0 || b.length - off < len)
throw new IndexOutOfBoundsException();
- if (b.length == 0)
- return 0;
int i, ch;
OpenPOWER on IntegriCloud