diff options
-rw-r--r-- | xml2tsv.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -58,7 +58,7 @@ void stack_init(tstack_t *t){ /* utility functions */ -void print_no_cr(FILE *f, const char *s){ +void quote_print(FILE *f, const char *s){ const char *tmp = s; size_t len; while (*tmp != '\0'){ @@ -136,7 +136,7 @@ xmlcdatastart(XMLParser *x) void xmlcdata(XMLParser *x, const char *d, size_t dl) { - print_no_cr(stdout, d); + quote_print(stdout, d); } void @@ -162,7 +162,7 @@ xmlcommentend(XMLParser *x) void xmldata(XMLParser *x, const char *d, size_t dl) { - print_no_cr(stdout, d); + quote_print(stdout, d); } void @@ -251,5 +251,10 @@ main(void) xml_parse(&x); printf("\n"); + if (! stack_empty(&st)) { + fprintf(stderr, "Error: tags still open at EOF: "); + print_cur_str(stderr, &st); + fprintf(stderr, "\n"); + } return 0; } |