summaryrefslogtreecommitdiffstats
path: root/examples/sample.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sample.c')
-rw-r--r--examples/sample.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/sample.c b/examples/sample.c
index 8f86f56..c7fec6c 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) {