From 9307fbdf54737bbcdb25826f5d4c66172ee4eb15 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 16 Aug 2015 11:05:44 -0700 Subject: [PATCH] MUX: Fix attach parsing of Log File names and no telnet options. Issue found by Ed Marr. --- sim_tmxr.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sim_tmxr.c b/sim_tmxr.c index c8cacf52..c4f7cd97 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -2494,11 +2494,11 @@ while (*tptr) { return SCPE_ARG; } lp->packet = packet; - sock = sim_connect_sock_ex (datagram ? listen : NULL, destination, "localhost", NULL, (datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | (packet ? SIM_SOCK_OPT_NODELAY : 0)); + sock = sim_connect_sock_ex (datagram ? listen : NULL, hostport, "localhost", NULL, (datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | (packet ? SIM_SOCK_OPT_NODELAY : 0)); if (sock != INVALID_SOCKET) { _mux_detach_line (lp, FALSE, TRUE); - lp->destination = (char *)malloc(1+strlen(destination)); - strcpy (lp->destination, destination); + lp->destination = (char *)malloc(1+strlen(hostport)); + strcpy (lp->destination, hostport); lp->mp = mp; if (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR)) { lp->connecting = sock; @@ -2523,7 +2523,7 @@ while (*tptr) { sim_close_logfile (&lp->txlogref); lp->txlog = NULL; lp->txlogname = (char *)realloc (lp->txlogname, 1 + strlen (logfiletmpl)); - strcpy (lp->txlogname, mp->logfiletmpl); + strcpy (lp->txlogname, logfiletmpl); r = sim_open_logfile (lp->txlogname, TRUE, &lp->txlog, &lp->txlogref); if (r == SCPE_OK) setvbuf(lp->txlog, NULL, _IOFBF, 65536); @@ -2600,11 +2600,11 @@ while (*tptr) { else return SCPE_ARG; } - sock = sim_connect_sock_ex (datagram ? listen : NULL, destination, "localhost", NULL, (datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | (packet ? SIM_SOCK_OPT_NODELAY : 0)); + sock = sim_connect_sock_ex (datagram ? listen : NULL, hostport, "localhost", NULL, (datagram ? SIM_SOCK_OPT_DATAGRAM : 0) | (packet ? SIM_SOCK_OPT_NODELAY : 0)); if (sock != INVALID_SOCKET) { _mux_detach_line (lp, FALSE, TRUE); - lp->destination = (char *)malloc(1+strlen(destination)); - strcpy (lp->destination, destination); + lp->destination = (char *)malloc(1+strlen(hostport)); + strcpy (lp->destination, hostport); if (!lp->modem_control || (lp->modembits & TMXR_MDM_DTR)) { lp->connecting = sock; lp->ipad = (char *)malloc (1 + strlen (lp->destination));