aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-02-05 11:13:41 +0100
committerAndreas Schneider <asn@cryptomilk.org>2011-02-05 15:23:19 +0100
commit4b07157fc6fab92cbc9ad1919c892462b41a5712 (patch)
tree447cc038bb17c27d6c910b66e9fd2f43bf76a76d /src
parent867944b939383baf28f573ee7ee3ba03805b25eb (diff)
downloadlibssh-4b07157fc6fab92cbc9ad1919c892462b41a5712.tar.gz
libssh-4b07157fc6fab92cbc9ad1919c892462b41a5712.tar.xz
libssh-4b07157fc6fab92cbc9ad1919c892462b41a5712.zip
getpass: Fixed a compiler warning.
Diffstat (limited to 'src')
-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';