aboutsummaryrefslogtreecommitdiff
path: root/examples/authentication.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-03-29 22:44:20 +0200
committerAndreas Schneider <mail@cynapses.org>2010-03-29 22:44:20 +0200
commit32ac1e04ec0a05f88cf257456dfcdd1515544283 (patch)
tree2f99ae971137eb2c0282dfd46187925de0b01489 /examples/authentication.c
parenta47a9ecad1fafa3784db8a67a9c9a3056024a331 (diff)
downloadlibssh-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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/authentication.c b/examples/authentication.c
index 988ed91f..3add1b2f 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;