Flush input when prompting for a password (bug 373).
authorRob Landley <rob@landley.net>
Mon, 12 Dec 2005 07:02:15 +0000 (07:02 -0000)
committerRob Landley <rob@landley.net>
Mon, 12 Dec 2005 07:02:15 +0000 (07:02 -0000)
libbb/bb_askpass.c

index 1ae1520..42ccd66 100644 (file)
@@ -44,6 +44,7 @@ char *bb_askpass(int timeout, const char * prompt)
        static char passwd[PWD_BUFFER_SIZE];
 
        tcgetattr(STDIN_FILENO, &old);
+       tcflush(STDIN_FILENO, TCIFLUSH);
 
        size = sizeof(passwd);
        ret = passwd;