Skip to content

Commit

Permalink
Fix bug with variable substitution in recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
fhaag95 committed Dec 12, 2023
1 parent b8bb013 commit 5402994
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/de/usd/cstchef/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,11 @@ public static ByteArray replaceVariablesByte(ByteArray bytes) {

public static ByteArray insertAtOffset(ByteArray input, int start, int end, ByteArray newValue) {
ByteArray prefix = input.subArray(0, start);
ByteArray rest = input.subArray(end, input.length());

ByteArray rest = ByteArray.byteArray("");
if (end != input.length()){
rest = input.subArray(end, input.length());
}

ByteArray output = prefix.withAppended(newValue).withAppended(rest);
return output;
}
Expand Down

0 comments on commit 5402994

Please sign in to comment.