From e5b1b98096e1f438700f3ec57a3587c359e2a8c4 Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Tue, 6 Aug 2019 15:44:15 +0100 Subject: [PATCH] examples: Add a final newline to the JSON output This is not significant to the machine-readable output, but is nicer for human readers. Signed-off-by: Simon McVittie <smcv@collabora.com> --- examples/system-info.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/system-info.c b/examples/system-info.c index de1292394..2946d0f6f 100644 --- a/examples/system-info.c +++ b/examples/system-info.c @@ -347,6 +347,9 @@ main (int argc, if (fputs (json_output, original_stdout) < 0) g_warning ("Unable to write output: %s", g_strerror (errno)); + if (fputs ("\n", original_stdout) < 0) + g_warning ("Unable to write final newline: %s", g_strerror (errno)); + if (fclose (original_stdout) != 0) g_warning ("Unable to close stdout: %s", g_strerror (errno)); -- GitLab