diff options
author | Rob Landley <rob@landley.net> | 2024-04-05 12:06:29 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2024-04-05 12:06:29 -0500 |
commit | 59b041d14aec3bc9f0b340efdcccd739ab8c7758 (patch) | |
tree | 48364e407e942fe55336a93410ccfbc4e2fad08d | |
parent | 9f7d285af66e80a8ac3b338b92bef4c1a17672ff (diff) | |
download | toybox-59b041d14aec3bc9f0b340efdcccd739ab8c7758.tar.gz |
Stdout buffering broke yet more stuff.
-rw-r--r-- | lib/password.c | 2 |
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; |