mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +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;
|
break;
|
||||||
case 'p': {
|
case 'p': {
|
||||||
char tmp[6];
|
char tmp[6];
|
||||||
|
unsigned int port;
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "%hu",
|
ssh_options_get_port(session, &port);
|
||||||
(uint16_t)(session->opts.port > 0 ? session->opts.port
|
snprintf(tmp, sizeof(tmp), "%u", port);
|
||||||
: 22));
|
|
||||||
x = strdup(tmp);
|
x = strdup(tmp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user