1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-31 00:03:07 +03:00

Fixed build warnings of the ssh client example.

This commit is contained in:
Andreas Schneider
2010-03-29 22:44:20 +02:00
parent a47a9ecad1
commit 32ac1e04ec
2 changed files with 19 additions and 5 deletions

View File

@ -44,7 +44,9 @@ int authenticate_kbdint(ssh_session session){
prompt=ssh_userauth_kbdint_getprompt(session,i,&echo);
if(echo){
printf("%s",prompt);
fgets(buffer,sizeof(buffer),stdin);
if (fgets(buffer,sizeof(buffer),stdin) == NULL) {
return SSH_AUTH_ERROR;
}
buffer[sizeof(buffer)-1]=0;
if((ptr=strchr(buffer,'\n')))
*ptr=0;