Skip to content

Commit bf2a6fe

Browse files
committed
Fix byte_array endianness reset when byte_array allocates more memory
Occurred first when a `byte_array` grows to size 1024, required calling `ba_set_little_endian(true)` again after more memory was allocated as a workaround. With this commit, the endianness is preserved correctly.
1 parent 32b284d commit bf2a6fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/laytonsmith/core/constructs/CByteArray.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ private void checkSize(int need, Integer pos) {
111111
int position = data.position();
112112
data.rewind();
113113
temp.put(data);
114+
temp.order(data.order());
115+
temp.position(position);
114116
data = temp;
115-
data.position(position);
116117
}
117118
value = null;
118119
}

0 commit comments

Comments
 (0)