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

Fixed build warnings in the knownhosts example.

This commit is contained in:
Andreas Schneider
2010-03-29 22:38:38 +02:00
parent d07aef725e
commit a47a9ecad1

View File

@ -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);