mirror of
https://github.com/simh/simh.git
synced 2026-04-26 03:57:11 +00:00
SCP/SOCKET: Apply default host more reasonably when parsing host:port strings
This commit is contained in:
15
sim_sock.c
15
sim_sock.c
@@ -604,7 +604,20 @@ if (host) /* host wanted? */
|
|||||||
if (strlen(hostp) >= host_len)
|
if (strlen(hostp) >= host_len)
|
||||||
return SCPE_ARG; /* no room */
|
return SCPE_ARG; /* no room */
|
||||||
else
|
else
|
||||||
strcpy (host, hostp);
|
if (('\0' != hostp[0]) || (default_host == NULL))
|
||||||
|
strcpy (host, hostp);
|
||||||
|
else
|
||||||
|
if (strlen(default_host) >= host_len)
|
||||||
|
return SCPE_ARG; /* no room */
|
||||||
|
else
|
||||||
|
strcpy (host, default_host);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (default_host)
|
||||||
|
if (strlen(default_host) >= host_len)
|
||||||
|
return SCPE_ARG; /* no room */
|
||||||
|
else
|
||||||
|
strcpy (host, default_host);
|
||||||
}
|
}
|
||||||
if (validate_addr) {
|
if (validate_addr) {
|
||||||
struct addrinfo *ai_host, *ai_validate, *ai;
|
struct addrinfo *ai_host, *ai_validate, *ai;
|
||||||
|
|||||||
Reference in New Issue
Block a user