aboutsummaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2017-12-23 23:31:20 +0100
committerAndreas Schneider <asn@cryptomilk.org>2017-12-28 20:42:53 +0100
commitc3c492a190475a96bddcfe3a10da74f7a0e0baba (patch)
tree113a36ab2a5d6f7a7ac21f6084167f2487dbf84d /src/config.c
parent778652460f7cceb3e760964a890ffd99ec8230e7 (diff)
downloadlibssh-c3c492a190475a96bddcfe3a10da74f7a0e0baba.tar.gz
libssh-c3c492a190475a96bddcfe3a10da74f7a0e0baba.tar.xz
libssh-c3c492a190475a96bddcfe3a10da74f7a0e0baba.zip
config: Avoid long -> int -> long casting for timeout configuration option
Fixes: T80 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/config.c b/src/config.c
index a95e0b63..99a1b332 100644
--- a/src/config.c
+++ b/src/config.c
@@ -251,9 +251,9 @@ out:
return r;
}
-static int ssh_config_get_int(char **str, int notfound) {
+static long ssh_config_get_long(char **str, long notfound) {
char *p, *endp;
- int i;
+ long i;
p = ssh_config_get_token(str);
if (p && *p) {
@@ -357,6 +357,7 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
char *lowerhost;
size_t len;
int i;
+ long l;
x = s = strdup(line);
if (s == NULL) {
@@ -507,9 +508,9 @@ static int ssh_config_parse_line(ssh_session session, const char *line,
}
break;
case SOC_TIMEOUT:
- i = ssh_config_get_int(&s, -1);
- if (i >= 0 && *parsing) {
- ssh_options_set(session, SSH_OPTIONS_TIMEOUT, &i);
+ l = ssh_config_get_long(&s, -1);
+ if (l >= 0 && *parsing) {
+ ssh_options_set(session, SSH_OPTIONS_TIMEOUT, &l);
}
break;
case SOC_STRICTHOSTKEYCHECK: