Merge branch 'release-0.1.4'
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / FcpUtils.java
index 415cf1a..26a407c 100644 (file)
@@ -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;
+                       }
                }
        }