jf2sfeed.c: fix: print the last item - jfconvert - JSON Feed (subset) to sfeed or Atom converter
(HTM) git clone git://git.codemadness.org/jfconvert
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit dd5f1d67da802e210e66abf707c4741a2c2b5845
(DIR) parent 283d0c62865adfe4ea69c696999720d3c9228a19
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Mon, 9 Sep 2024 18:11:32 +0200
jf2sfeed.c: fix: print the last item
Diffstat:
M jf2sfeed.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/jf2sfeed.c b/jf2sfeed.c
@@ -532,9 +532,6 @@ main(int argc, char *argv[])
if (pledge("stdio", NULL) == -1)
err(1, "pledge");
- if (itemisopen)
- printfields();
-
switch (parsejson(processnode)) {
case JSON_ERROR_MEM:
errx(2, "error: cannot allocate enough memory");
@@ -542,6 +539,9 @@ main(int argc, char *argv[])
errx(1, "error: invalid JSON");
}
+ if (itemisopen)
+ printfields();
+
if (ferror(stdin))
errx(2, "read error: <stdin>");
if (fflush(stdout) || ferror(stdout))