summaryrefslogtreecommitdiffstats
path: root/libssh/options.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-02 12:39:49 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-02 12:39:49 +0000
commit0dee53353150b1d535d1eec6d1b61a0e9bf22592 (patch)
treed29567bcc606d95fd06a2a7b3485014a8215aa4d /libssh/options.c
parent396db49a41444f72cd9635c1b602e667ff7a729a (diff)
downloadlibssh-0dee53353150b1d535d1eec6d1b61a0e9bf22592.tar.gz
libssh-0dee53353150b1d535d1eec6d1b61a0e9bf22592.tar.xz
libssh-0dee53353150b1d535d1eec6d1b61a0e9bf22592.zip
Improve ssh_options_allow_ssh2().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@367 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 11333ee5..66870c8d 100644
--- a/libssh/options.c
+++ b/libssh/options.c
@@ -691,16 +691,29 @@ int ssh_options_allow_ssh1(SSH_OPTIONS *opt, int allow) {
return 0;
}
-/** Default value is 1 (allow connection to SSH2 servers)
- * \brief allow or deny the connection to SSH2 servers
- * \param opt options structure
- * \param allow nonzero values allow ssh2
+/**
+ * @brief Allow or deny the connection to SSH2 servers.
+ *
+ * Default value is 1 (allow connection to SSH2 servers).
+ *
+ * @param opt The options structure to use.
+ *
+ * @param allow Non zero values allow ssh2.
+ *
+ * @return 0 on success, < 0 on error.
*/
-void ssh_options_allow_ssh2(SSH_OPTIONS *opt, int allow){
- if(allow)
- opt->ssh2allowed=1;
- else
- opt->ssh2allowed=0;
+int ssh_options_allow_ssh2(SSH_OPTIONS *opt, int allow) {
+ if (opt == NULL) {
+ return -1;
+ }
+
+ if (allow) {
+ opt->ssh2allowed = 1;
+ } else {
+ opt->ssh2allowed = 0;
+ }
+
+ return 0;
}
/** Default is a write on stderr