summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIIMarckus <iimarckus@gmail.com>2011-03-16 17:42:35 -0600
committerIIMarckus <iimarckus@gmail.com>2011-03-16 17:42:35 -0600
commit668eefaa15ffff6415de837fc280009feba2483a (patch)
treea73d9da0d61a7d61b6d27b47e2930b2716ff233e
parentbe114145c3536b24be7972916547ccc53ff9c887 (diff)
$0 is a valid tile in maps, even though $00 is the terminating byte.
Pointed out by Sawakita. hg-commit-id: 27881f5e6bd4
-rw-r--r--extras/redrle.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/extras/redrle.c b/extras/redrle.c
index d0a77a46..e753b3a1 100644
--- a/extras/redrle.c
+++ b/extras/redrle.c
@@ -64,11 +64,11 @@ main(int argc, char *argv[])
for (;;) {
int i, count;
int byte = fgetc(infile);
+ if (byte == 0)
+ break;
count = byte & 0xF;
byte >>= 4;
- if (byte == 0)
- break;
if (feof(infile)) {
fprintf(stderr, "Decompress error: reached "
"end of file without finding terminating "
@@ -101,12 +101,6 @@ main(int argc, char *argv[])
exit(1);
}
- if (byte == 0) {
- fprintf(stderr, "Compress error: read a byte "
- "of 0x00.\n");
- exit(1);
- }
-
if (byte == lastbyte)
++count;
else {