aboutsummaryrefslogtreecommitdiff
path: root/src/getpass.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/getpass.c')
-rw-r--r--src/getpass.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/getpass.c b/src/getpass.c
index eaf8029c..62f323e6 100644
--- a/src/getpass.c
+++ b/src/getpass.c
@@ -60,7 +60,9 @@ static int ssh_gets(const char *prompt, char *buf, size_t len, int verify) {
fprintf(stdout, "%s", prompt);
}
fflush(stdout);
- fgets(tmp, len, stdin);
+ if (fgets(tmp, len, stdin) == NULL) {
+ return 0;
+ }
if ((ptr = strchr(tmp, '\n'))) {
*ptr = '\0';