AppleSingle entry can have a length of 0. Adjusting how 0 byte entries

are reported.
This commit is contained in:
Rob Greene 2022-06-05 16:47:21 -05:00
parent 0b1459931b
commit 0651919ca0
1 changed files with 5 additions and 1 deletions

View File

@ -32,6 +32,9 @@ public class HexDumper {
description = ""; // Only on first line!
offset += line.length;
}
if (data.length == 0) {
printLine.print(address+offset, data, String.format("%s (empty)", description));
}
}
public void standardLine(int address, byte[] data, String description) {
@ -48,7 +51,8 @@ public class HexDumper {
char ch = ' ';
if (i < data.length) {
byte b = data[i];
ch = (b >= ' ' && Byte.toUnsignedInt(b) != 0xff) ? (char)b : '.';
//ch = (Character.isISOControl(Byte.toUnsignedInt(b))) ? '.' : (char)b;
ch = (b >= ' ' && Byte.toUnsignedInt(b) < 0x7f) ? (char)b : '.';
}
ps.printf("%c", ch);
}