diff options
author | Andreas Schneider <mail@cynapses.org> | 2010-03-29 22:38:38 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2010-03-29 22:38:38 +0200 |
commit | a47a9ecad1fafa3784db8a67a9c9a3056024a331 (patch) | |
tree | af1420b46bb7031c13dd2bb4866b9996999ff92f /examples/knownhosts.c | |
parent | d07aef725e05f02e34d89bce8543a975052f4a6d (diff) | |
download | libssh-a47a9ecad1fafa3784db8a67a9c9a3056024a331.tar.gz libssh-a47a9ecad1fafa3784db8a67a9c9a3056024a331.tar.xz libssh-a47a9ecad1fafa3784db8a67a9c9a3056024a331.zip |
Fixed build warnings in the knownhosts example.
Diffstat (limited to 'examples/knownhosts.c')
-rw-r--r-- | examples/knownhosts.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/knownhosts.c b/examples/knownhosts.c index d57ad455..f4160dd7 100644 --- a/examples/knownhosts.c +++ b/examples/knownhosts.c @@ -63,12 +63,16 @@ int verify_knownhost(ssh_session session){ fprintf(stderr,"The server is unknown. Do you trust the host key ?\n"); fprintf(stderr, "Public key hash: %s\n", hexa); free(hexa); - fgets(buf,sizeof(buf),stdin); + if (fgets(buf, sizeof(buf), stdin) == NULL) { + return -1; + } if(strncasecmp(buf,"yes",3)!=0){ return -1; } fprintf(stderr,"This new key will be written on disk for further usage. do you agree ?\n"); - fgets(buf,sizeof(buf),stdin); + if (fgets(buf, sizeof(buf), stdin) == NULL) { + return -1; + } if(strncasecmp(buf,"yes",3)==0){ if (ssh_write_knownhost(session) < 0) { free(hash); |