mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-06 10:27:22 +09:00
misc: Rewrite custom getting of port to use options API
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Pavol Žáčik <pzacik@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -1437,10 +1437,10 @@ char *ssh_path_expand_escape(ssh_session session, const char *s)
|
||||
break;
|
||||
case 'p': {
|
||||
char tmp[6];
|
||||
unsigned int port;
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%hu",
|
||||
(uint16_t)(session->opts.port > 0 ? session->opts.port
|
||||
: 22));
|
||||
ssh_options_get_port(session, &port);
|
||||
snprintf(tmp, sizeof(tmp), "%u", port);
|
||||
x = strdup(tmp);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user