projects
/
jFCPlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Avoid one case of getting out of synch and trying to read too much.
[jFCPlib.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
fcp
/
FcpUtils.java
diff --git
a/src/main/java/net/pterodactylus/fcp/FcpUtils.java
b/src/main/java/net/pterodactylus/fcp/FcpUtils.java
index
415cf1a
..
26a407c
100644
(file)
--- a/
src/main/java/net/pterodactylus/fcp/FcpUtils.java
+++ b/
src/main/java/net/pterodactylus/fcp/FcpUtils.java
@@
-268,7
+268,9
@@
public class FcpUtils {
throw new EOFException("stream reached eof");
}
destination.write(buffer, 0, read);
- remaining -= read;
+ if (remaining > 0) {
+ remaining -= read;
+ }
}
}