summaryrefslogtreecommitdiff
path: root/libc/unistd/getpass.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-07-30 16:54:31 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-07-30 16:54:31 +0000
commit249c30a44ade5e35b88bdba43ed7ad47f540c5ce (patch)
tree944ad7a5ee2b8f39173b8af192b511d221d93d98 /libc/unistd/getpass.c
parent1569b74b9f317694221f25f2435aa8a8c14b3ca5 (diff)
make utent.c, getpass.c use __uc_malloc
Diffstat (limited to 'libc/unistd/getpass.c')
-rw-r--r--libc/unistd/getpass.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libc/unistd/getpass.c b/libc/unistd/getpass.c
index 34dbf355b..9eb28ae18 100644
--- a/libc/unistd/getpass.c
+++ b/libc/unistd/getpass.c
@@ -20,7 +20,7 @@
#include <string.h>
#include <termios.h>
#include <unistd.h>
-#include <string.h>
+#include <malloc.h>
#if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
@@ -52,12 +52,16 @@ char *
getpass (prompt)
const char *prompt;
{
+ static char *buf;
+
FILE *in, *out;
struct termios s, t;
int tty_changed;
- static char buf[PWD_BUFFER_SIZE];
int nread;
+ free(buf);
+ buf = __uc_malloc(PWD_BUFFER_SIZE);
+
/* Try to write to and read from the terminal if we can.
If we can't open the terminal, use stderr and stdin. */