Fix InputStream matcher.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 26 Oct 2013 15:24:16 +0000 (17:24 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:46 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/fcp/FcpInterfaceTest.java

index 12b820d..bbbf509 100644 (file)
@@ -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;