1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-05-19 07:13:42 +03:00

Getpass: fixed loop + indentation

This commit is contained in:
Aris Adamantiadis 2011-01-26 21:49:58 +01:00
parent 5d87ca94a8
commit 00d68d63fa

View File

@ -60,7 +60,7 @@ 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);
while (fgets(tmp, len, stdin) != NULL); fgets(tmp, len, stdin);
if ((ptr = strchr(tmp, '\n'))) { if ((ptr = strchr(tmp, '\n'))) {
*ptr = '\0'; *ptr = '\0';
@ -78,7 +78,7 @@ static int ssh_gets(const char *prompt, char *buf, size_t len, int verify) {
if (key_string == NULL) { if (key_string == NULL) {
break; break;
} }
memset(key_string, '\0', len); memset(key_string, '\0', len);
fprintf(stdout, "\nVerifying, please re-enter. %s", prompt); fprintf(stdout, "\nVerifying, please re-enter. %s", prompt);
fflush(stdout); fflush(stdout);
@ -260,7 +260,7 @@ int ssh_getpass(const char *prompt,
if (!ok) { if (!ok) {
memset (buf, '\0', len); memset (buf, '\0', len);
return -1; return -1;
} }
/* force termination */ /* force termination */