From 436a65c2819d83cd7b6743d6a535bd69c5ab5968 Mon Sep 17 00:00:00 2001 From: catbref Date: Thu, 21 Nov 2019 17:28:49 +0000 Subject: [PATCH] Fix wrong operator when calculating creationBytesLength --- Java/src/main/java/org/ciyam/at/MachineState.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Java/src/main/java/org/ciyam/at/MachineState.java b/Java/src/main/java/org/ciyam/at/MachineState.java index 4bf7866..b111637 100644 --- a/Java/src/main/java/org/ciyam/at/MachineState.java +++ b/Java/src/main/java/org/ciyam/at/MachineState.java @@ -451,7 +451,7 @@ public class MachineState { throw new IllegalArgumentException("Empty data bytes"); short numDataPages = (short) (((dataBytes.length - 1) / constants.DATA_PAGE_SIZE) + 1); - int creationBytesLength = HEADER_LENGTH + numCodePages * constants.CODE_PAGE_SIZE + numDataPages + constants.DATA_PAGE_SIZE; + int creationBytesLength = HEADER_LENGTH + numCodePages * constants.CODE_PAGE_SIZE + numDataPages * constants.DATA_PAGE_SIZE; byte[] creationBytes = new byte[creationBytesLength]; ByteBuffer byteBuffer = ByteBuffer.wrap(creationBytes);