Improve ssh_options_set_username().

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@349 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
Andreas Schneider
2009-04-02 10:18:01 +00:00
parent ab54736b5d
commit 8de3dc44ca
3 changed files with 30 additions and 11 deletions

View File

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