From 6c312b95ba3e8d53647057dc92fa3ba2feab8c5b Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Tue, 13 Sep 2016 19:36:48 +0200 Subject: We don't need to check if there is a space or not --- mxml.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mxml.c b/mxml.c index 06be305..8bb4e32 100644 --- a/mxml.c +++ b/mxml.c @@ -6,7 +6,6 @@ int process(FILE *f) { mxml_node_t *root, *node, *next; const char* elename; - int space = 0; root = mxmlLoadFile(NULL, f, MXML_TEXT_CALLBACK); @@ -24,14 +23,13 @@ int process(FILE *f) { if (!strcmp(elename, "article-title")) { printf("article title:"); for (mxml_node_t *txt = next->child; txt; txt = mxmlGetNextSibling(txt)) { - + // Thanks to + // // https://github.com/younix/sj/blob/master/messaged.c#L237 - const char* text = mxmlGetText(txt, &space); - //if (space) { - printf(" %s", text); - //} - + const char* text = mxmlGetText(txt, NULL); + printf(" %s", text); } + printf("\n"); break; } -- cgit v1.2.3