From 068a7dfc494f1be5263a0336bba48acc893d66a8 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 22 Sep 2009 20:36:57 +0200 Subject: Fixed bindport in getop function. --- libssh/options.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libssh/options.c b/libssh/options.c index 8152c908..d7afd811 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); -- cgit