oglueck 2002/09/19 03:15:09
Modified: httpclient/src/java/org/apache/commons/httpclient
ContentLengthInputStream.java
Log:
corrected an off-by-one error
Revision Changes Path
1.2 +5 -5
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/ContentLengthInputStream.java
Index: ContentLengthInputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/ContentLengthInputStream.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ContentLengthInputStream.java 2 Sep 2002 14:52:47 -0000 1.1
+++ ContentLengthInputStream.java 19 Sep 2002 10:15:08 -0000 1.2
@@ -88,14 +88,14 @@
}
public int read() throws java.io.IOException {
- if (pos > contentLength) return -1;
+ if (pos >= contentLength) return -1;
pos++;
return super.read();
}
public int read(byte[] b, int off, int len) throws java.io.IOException {
- if (pos > contentLength) return -1;
+ if (pos >= contentLength) return -1;
if (pos + len > contentLength) {
len = contentLength - pos;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>