Skip to content

Commit

Permalink
Use String Methods
Browse files Browse the repository at this point in the history
- Revert length check, test for empty string

Needs a lot of parentheses but it works
  • Loading branch information
SuperDude88 authored and Maschell committed Jun 29, 2024
1 parent c4370fd commit 3d66702
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/cafeloader/Cafe_ElfExtension.java
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private void processRplFileInfo(ElfLoadHelper elfLoadHelper, ElfSectionHeader se
Address tagAddress = fileInfoAddr.add(tagOffset);
while (true) {
Data d = elfLoadHelper.createData(tagAddress, TerminatedStringDataType.dataType);
if (d == null || d.getLength() <= 1) { // empty string has a length of 1 (just a null terminator)
if (d == null || d.getLength() == 0 || (d.hasStringValue() && ((String)d.getValue()).isEmpty())) {
break;
}
tagAddress = tagAddress.add(d.getLength());
Expand Down

0 comments on commit 3d66702

Please sign in to comment.