From 029c892359387bb45f81d14e8530082ec8de7e85 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Tue, 14 Nov 2023 12:23:18 -0800 Subject: [PATCH] Flush stdout before changing mode back to text --- tools/io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/io.h b/tools/io.h index 8bbee3a0df..a48e3c325e 100644 --- a/tools/io.h +++ b/tools/io.h @@ -144,6 +144,7 @@ class OutputFile { ~OutputFile() { if (fp_ == stdout) { + fflush(stdout); SET_STDOUT_MODE(old_mode_); } else if (fp_ != nullptr) { fclose(fp_);