From 4d80d8db895571487046ae5d8751ffeafa9c5c31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 26 Oct 2013 17:24:16 +0200 Subject: [PATCH] Fix InputStream matcher. --- src/test/java/net/pterodactylus/sone/fcp/FcpInterfaceTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; -- 2.7.4