Java agent: Use inequality for read bound check
[lttng-ust.git] / liblttng-ust-java-agent / java / lttng-ust-agent-common / org / lttng / ust / agent / client / LttngTcpSessiondClient.java
index 0f979a4f88da7d7fa97da19c6786f0dcc9fe1e90..d42bc9af4ee112c105ee48605b58c1c98843ba09 100644 (file)
@@ -367,7 +367,7 @@ public class LttngTcpSessiondClient implements Runnable {
                int bytesLeft = data.length;
                int bytesOffset = 0;
 
-               while (bytesLeft != 0) {
+               while (bytesLeft >= 0) {
                        int bytesRead = this.inFromSessiond.read(data, bytesOffset, bytesLeft);
 
                        if (bytesRead < 0) {
@@ -396,7 +396,7 @@ public class LttngTcpSessiondClient implements Runnable {
                        return null;
                }
 
-               while (bytesLeft != 0) {
+               while (bytesLeft >= 0) {
                        int bytesRead = inFromSessiond.read(payload, bytesOffset, bytesLeft);
 
                        if (bytesRead < 0) {
This page took 0.023931 seconds and 4 git commands to generate.