aboutsummaryrefslogtreecommitdiff
path: root/json-rpc-shell.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-01-22 14:39:41 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-01-22 14:39:41 +0100
commitdc8e84d27a73a0052e6e978cb914420b2999d8bb (patch)
tree0cdbfba62a2b1f03ebfd20a5b96ab2298778b999 /json-rpc-shell.c
parenta9df3059cf4aab3139ce9b6c85458e4ea31a5a36 (diff)
downloadjson-rpc-shell-dc8e84d27a73a0052e6e978cb914420b2999d8bb.tar.gz
json-rpc-shell-dc8e84d27a73a0052e6e978cb914420b2999d8bb.tar.xz
json-rpc-shell-dc8e84d27a73a0052e6e978cb914420b2999d8bb.zip
Flush output properly
Diffstat (limited to 'json-rpc-shell.c')
-rw-r--r--json-rpc-shell.c6
1 files changed, 5 insertions, 1 deletions
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);
}