X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2FFcpUtils.java;h=26a407cd5c78e2585ac051fea4333282b91657ef;hb=a061300d59fefdb2cbac25d3ee1658fecc3d1cbf;hp=095708366bec6b54823f8daa6ce0ec105355d771;hpb=508624458578f01a393f8b44f32b98b40054fdc8;p=jFCPlib.git
diff --git a/src/main/java/net/pterodactylus/fcp/FcpUtils.java b/src/main/java/net/pterodactylus/fcp/FcpUtils.java
index 0957083..26a407c 100644
--- a/src/main/java/net/pterodactylus/fcp/FcpUtils.java
+++ b/src/main/java/net/pterodactylus/fcp/FcpUtils.java
@@ -110,8 +110,8 @@ public class FcpUtils {
}
/**
- * Tries to parse the given string into an int, returning -1
if
- * the string can not be parsed.
+ * Tries to parse the given string into an int, returning -1
+ * if the string can not be parsed.
*
* @param value
* The string to parse
@@ -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;
+ }
}
}