aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2024-04-05 12:06:29 -0500
committerRob Landley <rob@landley.net>2024-04-05 12:06:29 -0500
commit59b041d14aec3bc9f0b340efdcccd739ab8c7758 (patch)
tree48364e407e942fe55336a93410ccfbc4e2fad08d
parent9f7d285af66e80a8ac3b338b92bef4c1a17672ff (diff)
downloadtoybox-59b041d14aec3bc9f0b340efdcccd739ab8c7758.tar.gz
Stdout buffering broke yet more stuff.
-rw-r--r--lib/password.c2
1 files changed, 2 insertions, 0 deletions
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;