From be6fd520dc5a19a0d08a308cb2152f2d2a14f71f Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Thu, 14 Sep 2023 18:00:09 -0700 Subject: [PATCH] Prompt output: Line-buffered --- uniqt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/uniqt.c b/uniqt.c index b755f4e..a42a001 100644 --- a/uniqt.c +++ b/uniqt.c @@ -54,6 +54,8 @@ static void write_line(time_range_t *range, char *line) { return; if (printf("%ld %ld %s\n", range->start, range->end, line) < 0) die("Couldn't write"); + if (fflush(stdout) == EOF) + die_err("Couldn't flush"); } static int same(char *a, char *b) { return a && b && strcmp(a, b) == 0; } -- 2.44.1