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>
Этот коммит содержится в:
родитель
778652460f
Коммит
c3c492a190
11
src/config.c
11
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:
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user