Skip to content

Commit 7e81a81

Browse files
committed
Fix #39.
1 parent 6329970 commit 7e81a81

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/main/java/ch/ethz/ssh2/SCPInputStream.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ public int read() throws IOException
7878
return -1;
7979
}
8080

81-
int read = super.read();
82-
if (read < 0)
81+
int b = super.read();
82+
if (b < 0)
8383
{
8484
throw new IOException("Remote scp terminated connection unexpectedly");
8585
}
8686

87-
remaining -= read;
87+
remaining -= 1;
8888

89-
return read;
89+
return b;
9090
}
9191

9292
@Override

src/main/java/ch/ethz/ssh2/SFTPInputStream.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ public int read(byte[] buffer, int offset, int len) throws IOException
5959
@Override
6060
public int read() throws IOException {
6161
byte[] buffer = new byte[1];
62-
int read = handle.getClient().read(handle, readOffset, buffer, 0, 1);
63-
if(read > 0) {
64-
readOffset += read;
62+
int b = handle.getClient().read(handle, readOffset, buffer, 0, 1);
63+
if(b > 0) {
64+
readOffset += 1;
6565
}
66-
return read;
66+
return b;
6767
}
6868

6969
/**

0 commit comments

Comments
 (0)