From dc8e84d27a73a0052e6e978cb914420b2999d8bb Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Fri, 22 Jan 2016 14:39:41 +0100 Subject: Flush output properly --- json-rpc-shell.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/json-rpc-shell.c b/json-rpc-shell.c index f986669..0830aae 100644 --- a/json-rpc-shell.c +++ b/json-rpc-shell.c @@ -2690,6 +2690,7 @@ json_highlight (struct app_context *ctx, const char *s, FILE *output) enum jtoken token; while ((token = jtokenizer_next (&self.tokenizer))) json_highlight_value (&self, token); + fflush (output); jtokenizer_free (&self.tokenizer); } @@ -2887,7 +2888,10 @@ make_json_rpc_call (struct app_context *ctx, if (!req_term) print_error ("%s: %s", "verbose", "character conversion failed"); else - print_attributed (ctx, stdout, ATTR_OUTGOING, "%s\n", req_term); + { + print_attributed (ctx, stdout, ATTR_OUTGOING, "%s", req_term); + fputs ("\n", stdout); + } free (req_term); } -- cgit v1.2.3-70-g09d2