From: David ‘Bombe’ Roden Date: Sat, 26 Oct 2013 15:24:16 +0000 (+0200) Subject: Fix InputStream matcher. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4d80d8db895571487046ae5d8751ffeafa9c5c31;p=Sone.git Fix InputStream matcher. --- diff --git a/src/test/java/net/pterodactylus/sone/fcp/FcpInterfaceTest.java b/src/test/java/net/pterodactylus/sone/fcp/FcpInterfaceTest.java index 12b820d..bbbf509 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/FcpInterfaceTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/FcpInterfaceTest.java @@ -315,10 +315,13 @@ public class FcpInterfaceTest { if (r == -1) { return offset == data.length; } - readData[offset] = (byte) r; - if (data[offset++] != r) { + if (offset == data.length) { return false; } + if (data[offset] != (readData[offset] = (byte) r)) { + return false; + } + offset++; } } catch (IOException ioe1) { return false;