summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-02-15 17:09:34 (EST)
committer P. J. McDermott <pjm@nac.net>2013-02-15 17:09:34 (EST)
commit858fa5782ff29ce007e3f50a257efb7014cf556e (patch)
tree5475e6c61db45c6f0b700f42ead9902ed9707eba /src
parentc978f746058497ddd9ddc9cf3e156c4453e487f1 (diff)
downloadoverworld-rpg-858fa5782ff29ce007e3f50a257efb7014cf556e.zip
overworld-rpg-858fa5782ff29ce007e3f50a257efb7014cf556e.tar.gz
overworld-rpg-858fa5782ff29ce007e3f50a257efb7014cf556e.tar.bz2
src/tmx.c: Silence some compiler warnings.
Diffstat (limited to 'src')
-rw-r--r--src/tmx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tmx.c b/src/tmx.c
index 731f76c..4695a9e 100644
--- a/src/tmx.c
+++ b/src/tmx.c
@@ -119,9 +119,13 @@ tmx_start_image(struct tmx *cur_tmx, const char **attr)
err(1, "Malformed TMX file");
}
+ source = NULL;
foreach_tmx_attr (attr) {
tmx_get_string_attr(attr, "source", source);
}
+ if (source == NULL) {
+ err(1, "No \"source\" attribute found in \"image\" tag");
+ }
/* TODO: Move to end tag handler and check for "loadimage" property. */
path = malloc(strlen(cur_tmx->dirname) + strlen(source) + 2);
@@ -265,6 +269,10 @@ tmx_end_data(struct tmx *cur_tmx)
}
decompress(decoded_buf, decoded_len, decomp_buf, decomp_len);
free(decoded_buf);
+ } else {
+ /* This should never happen. This branch exists only to silence
+ * GCC's maybe-uninitialized warning on decomp_buf below. */
+ return;
}
free(cur_tmx->layer_data);