summaryrefslogtreecommitdiffstats
path: root/libssh/options.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-09-22 20:36:57 +0200
committerAndreas Schneider <mail@cynapses.org>2009-09-22 20:36:57 +0200
commit068a7dfc494f1be5263a0336bba48acc893d66a8 (patch)
tree147dcc154897c431ee55101ae79af604872859a1 /libssh/options.c
parentabd8b17a04488d1e625f37236185e3f45fa04d14 (diff)
downloadlibssh-068a7dfc494f1be5263a0336bba48acc893d66a8.tar.gz
libssh-068a7dfc494f1be5263a0336bba48acc893d66a8.tar.xz
libssh-068a7dfc494f1be5263a0336bba48acc893d66a8.zip
Fixed bindport in getop function.
Diffstat (limited to 'libssh/options.c')
-rw-r--r--libssh/options.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libssh/options.c b/libssh/options.c
index 8152c90..d7afd81 100644
--- a/libssh/options.c
+++ b/libssh/options.c
@@ -1249,11 +1249,15 @@ int ssh_options_getopt(SSH_OPTIONS *options, int *argcptr, char **argv) {
}
}
- ssh_options_set(options, SSH_OPTIONS_PORT_STR, port);
- if (bindport) {
+ if (cont && bindport) {
i = atoi(bindport);
- ssh_options_set(options, SSH_OPTIONS_BINDPORT, &i);
+ if (ssh_options_set(options, SSH_OPTIONS_SERVER_BINDPORT, &i) < 0) {
+ cont = 0;
+ }
}
+
+ ssh_options_set(options, SSH_OPTIONS_PORT_STR, port);
+
ssh_options_set(options, SSH_OPTIONS_SSH1, &ssh1);
ssh_options_set(options, SSH_OPTIONS_SSH2, &ssh2);