Skip to content

Commit

Permalink
Read only bytes of most recent message
Browse files Browse the repository at this point in the history
  • Loading branch information
brunchboy committed Oct 17, 2023
1 parent eb05d66 commit 98d06c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/deepsymmetry/bcj/Carabiner.java
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ public void run() {
int n = input.read(buffer);
if (n > 0 && runForConnectionNumber == connectionNumber.get()) {
// We got data, and were not told to shut down while reading.
String response = new String(buffer, StandardCharsets.UTF_8);
String response = new String(buffer, 0, n, StandardCharsets.UTF_8);
logger.debug("Received: {}", response);
for (String line : response.trim().split("\\R")) {
Message message = new Message(line);
Expand Down

0 comments on commit 98d06c6

Please sign in to comment.