diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2016-09-13 19:36:48 +0200 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2016-09-13 19:36:48 +0200 |
commit | 6c312b95ba3e8d53647057dc92fa3ba2feab8c5b (patch) | |
tree | c1dae70036795dfec6426eb9580267dc25d78483 | |
parent | bdadb5fe6f8fcbc76c8fb2c8e2979dd475543146 (diff) |
We don't need to check if there is a space or not
-rw-r--r-- | mxml.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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; } |