From 8de3dc44ca3dc4285d34925be5a7b4fee8e95408 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 2 Apr 2009 10:18:01 +0000 Subject: Improve ssh_options_set_username(). git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@349 7dcaeef0-15fb-0310-b436-a5af3365683c --- sample.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sample.c') diff --git a/sample.c b/sample.c index 543bcfcd..debb09a4 100644 --- a/sample.c +++ b/sample.c @@ -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; -- cgit