diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-01-23 20:08:25 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-01-24 13:55:05 +0100 |
commit | f3685f0f731434d8c94454fc12cebe1b5a0bdbb1 (patch) | |
tree | 6998603af818871df5390274deb8717a88ef180e /examples/sample.c | |
parent | 50a119dd0ac55763f965ba1660c132c2f58ed167 (diff) | |
download | libssh-f3685f0f731434d8c94454fc12cebe1b5a0bdbb1.tar.gz libssh-f3685f0f731434d8c94454fc12cebe1b5a0bdbb1.tar.xz libssh-f3685f0f731434d8c94454fc12cebe1b5a0bdbb1.zip |
examples: Use ssh_getpass().
Diffstat (limited to 'examples/sample.c')
-rw-r--r-- | examples/sample.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/sample.c b/examples/sample.c index 8f86f560..c7fec6c8 100644 --- a/examples/sample.c +++ b/examples/sample.c @@ -58,7 +58,10 @@ static int auth_callback(const char *prompt, char *buf, size_t len, *ptr = '\0'; } } else { - answer = getpass(prompt); + if (ssh_getpass(prompt, buf, len, 0, 0) < 0) { + return -1; + } + return 0; } if (answer == NULL) { |