]> git.scottworley.com Git - uniqt/commitdiff
Prompt output: Line-buffered
authorScott Worley <scottworley@scottworley.com>
Fri, 15 Sep 2023 01:00:09 +0000 (18:00 -0700)
committerScott Worley <scottworley@scottworley.com>
Fri, 15 Sep 2023 02:46:40 +0000 (19:46 -0700)
uniqt.c

diff --git a/uniqt.c b/uniqt.c
index b755f4eb9def577608ff1bd738a6489b12b38fb0..a42a0013cc3c1ca62c806db604bd59e06921de7e 100644 (file)
--- 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; }