1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-15 18:32:26 +03:00

getpass: Fixed a compiler warning.

This commit is contained in:
Andreas Schneider
2011-02-05 11:13:41 +01:00
parent 867944b939
commit 4b07157fc6

View File

@@ -60,7 +60,9 @@ static int ssh_gets(const char *prompt, char *buf, size_t len, int verify) {
fprintf(stdout, "%s", prompt); fprintf(stdout, "%s", prompt);
} }
fflush(stdout); fflush(stdout);
fgets(tmp, len, stdin); if (fgets(tmp, len, stdin) == NULL) {
return 0;
}
if ((ptr = strchr(tmp, '\n'))) { if ((ptr = strchr(tmp, '\n'))) {
*ptr = '\0'; *ptr = '\0';