summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvan Jegen <s.jegen@gmail.com>2016-09-13 19:36:48 +0200
committerSilvan Jegen <s.jegen@gmail.com>2016-09-13 19:36:48 +0200
commit6c312b95ba3e8d53647057dc92fa3ba2feab8c5b (patch)
treec1dae70036795dfec6426eb9580267dc25d78483
parentbdadb5fe6f8fcbc76c8fb2c8e2979dd475543146 (diff)
We don't need to check if there is a space or not
-rw-r--r--mxml.c12
1 files 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;
}