diff options
author | Andreas Schneider <mail@cynapses.org> | 2010-03-29 22:44:20 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2010-03-29 22:44:20 +0200 |
commit | 32ac1e04ec0a05f88cf257456dfcdd1515544283 (patch) | |
tree | 2f99ae971137eb2c0282dfd46187925de0b01489 /examples/authentication.c | |
parent | a47a9ecad1fafa3784db8a67a9c9a3056024a331 (diff) | |
download | libssh-32ac1e04ec0a05f88cf257456dfcdd1515544283.tar.gz libssh-32ac1e04ec0a05f88cf257456dfcdd1515544283.tar.xz libssh-32ac1e04ec0a05f88cf257456dfcdd1515544283.zip |
Fixed build warnings of the ssh client example.
Diffstat (limited to 'examples/authentication.c')
-rw-r--r-- | examples/authentication.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/authentication.c b/examples/authentication.c index 988ed91..3add1b2 100644 --- a/examples/authentication.c +++ b/examples/authentication.c @@ -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; |