diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-04-02 10:18:01 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-04-02 10:18:01 +0000 |
commit | 8de3dc44ca3dc4285d34925be5a7b4fee8e95408 (patch) | |
tree | 3d5f803f4fd54eea41ef32930c6e931045b03cf9 /sample.c | |
parent | ab54736b5d41df8588d3754f6b68e2c4c762413f (diff) | |
download | libssh-8de3dc44ca3dc4285d34925be5a7b4fee8e95408.tar.gz libssh-8de3dc44ca3dc4285d34925be5a7b4fee8e95408.tar.xz libssh-8de3dc44ca3dc4285d34925be5a7b4fee8e95408.zip |
Improve ssh_options_set_username().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@349 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'sample.c')
-rw-r--r-- | sample.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -420,8 +420,14 @@ int main(int argc, char **argv){ } opts(argc,argv); signal(SIGTERM, do_exit); - if(user) - ssh_options_set_username(options,user); + + if (user) { + if (ssh_options_set_username(options,user) < 0) { + ssh_options_free(options); + return 1; + } + } + if (ssh_options_set_host(options,host) < 0) { ssh_options_free(options); return 1; |