mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-11-11 15:54:49 +13:00
$0 is a valid tile in maps, even though $00 is the terminating byte.
Pointed out by Sawakita. hg-commit-id: 27881f5e6bd4
This commit is contained in:
parent
be114145c3
commit
668eefaa15
|
|
@ -64,11 +64,11 @@ main(int argc, char *argv[])
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int i, count;
|
int i, count;
|
||||||
int byte = fgetc(infile);
|
int byte = fgetc(infile);
|
||||||
|
if (byte == 0)
|
||||||
|
break;
|
||||||
count = byte & 0xF;
|
count = byte & 0xF;
|
||||||
byte >>= 4;
|
byte >>= 4;
|
||||||
|
|
||||||
if (byte == 0)
|
|
||||||
break;
|
|
||||||
if (feof(infile)) {
|
if (feof(infile)) {
|
||||||
fprintf(stderr, "Decompress error: reached "
|
fprintf(stderr, "Decompress error: reached "
|
||||||
"end of file without finding terminating "
|
"end of file without finding terminating "
|
||||||
|
|
@ -101,12 +101,6 @@ main(int argc, char *argv[])
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (byte == 0) {
|
|
||||||
fprintf(stderr, "Compress error: read a byte "
|
|
||||||
"of 0x00.\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (byte == lastbyte)
|
if (byte == lastbyte)
|
||||||
++count;
|
++count;
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue