aboutsummaryrefslogtreecommitdiff
path: root/sample.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-02 10:13:12 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-02 10:13:12 +0000
commit6026de46486913c40a9469267c429b2dfa57d806 (patch)
tree6fede1e55d6cef6544f263aad812b38afa87f320 /sample.c
parenta9ef024f1045f696e424c77d7bbde8ce324916ac (diff)
downloadlibssh-6026de46486913c40a9469267c429b2dfa57d806.tar.gz
libssh-6026de46486913c40a9469267c429b2dfa57d806.tar.xz
libssh-6026de46486913c40a9469267c429b2dfa57d806.zip
Improve ssh_options_set_host().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@347 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'sample.c')
-rw-r--r--sample.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sample.c b/sample.c
index 20b19c7..543bcfc 100644
--- a/sample.c
+++ b/sample.c
@@ -422,7 +422,10 @@ int main(int argc, char **argv){
signal(SIGTERM, do_exit);
if(user)
ssh_options_set_username(options,user);
- ssh_options_set_host(options,host);
+ if (ssh_options_set_host(options,host) < 0) {
+ ssh_options_free(options);
+ return 1;
+ }
session=ssh_new();
ssh_set_options(session,options);
if(ssh_connect(session)){