[FIXED JENKINS-8686]

As I mentioned in the comment, I doubt if this makes any behaviour change, but this seems like a sensible defensive measure that wouldn't hurt.
This commit is contained in:
Kohsuke Kawaguchi committed 2013-04-02 09:58:50 -07:00
1 parent 548373fad1
commit dc94b7d063
5 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -451,7 +451,7 @@ public class Util {
public static void copyStream(InputStream in,OutputStream out) throws IOException {
byte[] buf = new byte[8192];
int len;
while((len=in.read(buf))>0)
while((len=in.read(buf))>=0)
out.write(buf,0,len);
}
@@ -562,7 +562,7 @@ public class Util {
byte[] buffer = new byte[1024];
DigestInputStream in =new DigestInputStream(source,md5);
try {
while(in.read(buffer)>0)
while(in.read(buffer)>=0)
; // simply discard the input
} finally {
in.close();