From 59b041d14aec3bc9f0b340efdcccd739ab8c7758 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 5 Apr 2024 12:06:29 -0500 Subject: [PATCH] Stdout buffering broke yet more stuff. --- lib/password.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/password.c b/lib/password.c index f653e41d..461b4118 100644 --- a/lib/password.c +++ b/lib/password.c @@ -56,6 +56,7 @@ int read_password(char *buf, int buflen, char *mesg) int i, tty = tty_fd(), ret = 1; // Set NOP signal handler to return from the read. + fflush(0); sigaction(SIGINT, &sa, &oldsa); tcflush(tty, TCIFLUSH); xset_terminal(tty, 1, 0, &oldtermio); @@ -77,6 +78,7 @@ int read_password(char *buf, int buflen, char *mesg) tcsetattr(0, TCSANOW, &oldtermio); sigaction(SIGINT, &oldsa, 0); xputc('\n'); + fflush(0); buf[i*!ret] = 0; return ret; -- 2.39.2