Flush output properly

This commit is contained in:
Přemysl Eric Janouch 2016-01-22 14:39:41 +01:00
parent a9df3059cf
commit dc8e84d27a
1 changed files with 5 additions and 1 deletions

View File

@ -2690,6 +2690,7 @@ json_highlight (struct app_context *ctx, const char *s, FILE *output)
enum jtoken token; enum jtoken token;
while ((token = jtokenizer_next (&self.tokenizer))) while ((token = jtokenizer_next (&self.tokenizer)))
json_highlight_value (&self, token); json_highlight_value (&self, token);
fflush (output);
jtokenizer_free (&self.tokenizer); jtokenizer_free (&self.tokenizer);
} }
@ -2887,7 +2888,10 @@ make_json_rpc_call (struct app_context *ctx,
if (!req_term) if (!req_term)
print_error ("%s: %s", "verbose", "character conversion failed"); print_error ("%s: %s", "verbose", "character conversion failed");
else 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); free (req_term);
} }