Skip to content

Commit

Permalink
Fix a bug in BinaryExporter that's been there since my jMonkeyEngine …
Browse files Browse the repository at this point in the history
…days!

Files with over 256 class types in them would have caused an array index exception.  Probably unlikely, but, hey it's fixed now.
  • Loading branch information
Renanse committed Mar 11, 2024
1 parent ab5bd74 commit 71cea82
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,8 @@ protected int findPrevMatch(final BinaryIdContentPair oldPair, final List<Binary
protected byte[] fixClassAlias(final byte[] bytes, final int width) {
if (bytes.length != width) {
final byte[] newAlias = new byte[width];
for (int x = width - bytes.length; x < width; x++) {
newAlias[x] = bytes[x - bytes.length];
}
int startPos = width - bytes.length;
System.arraycopy(bytes, 0, newAlias, startPos, bytes.length);
return newAlias;
}
return bytes;
Expand Down

0 comments on commit 71cea82

Please sign in to comment.