summaryrefslogtreecommitdiffstats
path: root/libssh/options.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-02 12:37:45 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-02 12:37:45 +0000
commit396db49a41444f72cd9635c1b602e667ff7a729a (patch)
treee0fecaa09d132d3784b8d8b42a0b894cc3771ca2 /libssh/options.c
parent94e91b73f78218c586111c60c3df30bb82741c7a (diff)
downloadlibssh-396db49a41444f72cd9635c1b602e667ff7a729a.tar.gz
libssh-396db49a41444f72cd9635c1b602e667ff7a729a.tar.xz
libssh-396db49a41444f72cd9635c1b602e667ff7a729a.zip
Improve ssh_options_allow_ssh1().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@366 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/options.c')
-rw-r--r--libssh/options.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/libssh/options.c b/libssh/options.c
index 6e44db0..11333ee 100644
--- a/libssh/options.c
+++ b/libssh/options.c
@@ -666,16 +666,29 @@ int ssh_options_set_timeout(SSH_OPTIONS *opt, long seconds, long usec) {
return 0;
}
-/** Default value is 0 (no connection to SSH1 servers)
- * \brief allow or deny the connection to SSH1 servers
- * \param opt options structure
- * \param allow nonzero values allow ssh1
+/**
+ * @brief Allow or deny the connection to SSH1 servers.
+ *
+ * Default value is 0 (no connection to SSH1 servers).
+ *
+ * @param opt The options structure to use.
+ *
+ * @param allow Non zero value allow ssh1.
+ *
+ * @return 0 on success, < 0 on error.
*/
-void ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow){
- if(allow)
- opt->ssh1allowed=1;
- else
- opt->ssh1allowed=0;
+int ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow) {
+ if (opt == NULL) {
+ return -1;
+ }
+
+ if (allow) {
+ opt->ssh1allowed = 1;
+ } else {
+ opt->ssh1allowed = 0;
+ }
+
+ return 0;
}
/** Default value is 1 (allow connection to SSH2 servers)