From 4b07157fc6fab92cbc9ad1919c892462b41a5712 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sat, 5 Feb 2011 11:13:41 +0100 Subject: getpass: Fixed a compiler warning. --- src/getpass.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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'; -- cgit v1.2.3