summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2016-09-05 19:13:08 +0200
committerSilvan Jegen <s.jegen@gmail.com>2016-09-05 19:13:08 +0200
commit9cc211c51d9744bed3d7625dec78b906d454803b (patch)
treeab4e3dac38e01093f8b4f17837bf3576bd0028be
parentf48eafe9f85b1e002cddc6eb29ac0e9c18cc999d (diff)
Add file name to error output
-rw-r--r--ezxml.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ezxml.c b/ezxml.c
index 9b4f036..b02400f 100644
--- a/ezxml.c
+++ b/ezxml.c
@@ -6,7 +6,7 @@
int process(char *fn) {
ezxml_t ezdoc = ezxml_parse_file(fn);
if (!ezdoc) {
- fprintf(stderr, "Error when parsing file.\n");
+ fprintf(stderr, "Error when parsing file '%s'.\n", fn);
}
ezxml_t title = ezxml_get(ezdoc, "front", 0, "article-meta", 0, "title-group", 0, "article-title", -1);
@@ -16,7 +16,7 @@ int process(char *fn) {
ezxml_t body = ezxml_get(ezdoc, "body", -1);
if (!body) {
- fprintf(stderr, "Body not found\n");
+ fprintf(stderr, "No body-tag found in file '%s'\n", fn);
}
for (ezxml_t c = ezxml_child(body, "sec"); c; c = c->next) {
ezxml_t t = ezxml_get(c, "title", -1);