From 8b11bfe143b61a2e64f1d402ba095ee76db4a966 Mon Sep 17 00:00:00 2001 From: "T.Elias" Date: Fri, 24 Nov 2023 01:01:11 +0100 Subject: [PATCH] applied @barspi solution and changed getUninterpretLength(Integer, Interpeter) --- .../java/org/jpos/tlv/packager/bertlv/BERTLVPackager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jpos/src/main/java/org/jpos/tlv/packager/bertlv/BERTLVPackager.java b/jpos/src/main/java/org/jpos/tlv/packager/bertlv/BERTLVPackager.java index d0124677f4..9d02d59519 100644 --- a/jpos/src/main/java/org/jpos/tlv/packager/bertlv/BERTLVPackager.java +++ b/jpos/src/main/java/org/jpos/tlv/packager/bertlv/BERTLVPackager.java @@ -447,7 +447,7 @@ public void unpack(ISOComponent m, InputStream in) throws IOException, ISOExcept private int getUninterpretLength(int length, BinaryInterpreter interpreter) { if (length > 0) { int lengthAdjusted = length + length % 2; - return (int) (length * (lengthAdjusted / (double) interpreter.getPackedLength(lengthAdjusted))); + return (length * lengthAdjusted) / interpreter.getPackedLength(lengthAdjusted); } return 0; } @@ -455,7 +455,7 @@ private int getUninterpretLength(int length, BinaryInterpreter interpreter) { private int getUninterpretLength(int length, Interpreter interpreter) { if (length > 0) { int lengthAdjusted = length + length % 2; - return length * (lengthAdjusted / interpreter.getPackedLength(lengthAdjusted)); + return (length * lengthAdjusted) / interpreter.getPackedLength(lengthAdjusted); } return 0; }