diff --git a/sim_tmxr.c b/sim_tmxr.c index 6efff478..75874755 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -439,6 +439,8 @@ static u_char mantra[] = { /* Telnet Option Negotiation Mantra TN_IAC, TN_DO, TN_BIN }; +#define TMXR_GUARD ((int32)(lp->serport ? 0 : sizeof(mantra)))/* buffer guard */ + /* Local routines */ static void tmxr_add_to_open_list (TMXR* mux); @@ -2027,7 +2029,7 @@ if ((lp->conn == FALSE) && /* no conn & not buffere return SCPE_LOST; } tmxr_debug_trace_line (lp, "tmxr_putc_ln()"); -#define TXBUF_AVAIL(lp) (lp->txbsz - tmxr_tqln (lp)) +#define TXBUF_AVAIL(lp) ((lp->serport ? 1: lp->txbsz) - tmxr_tqln (lp)) #define TXBUF_CHAR(lp, c) { \ lp->txb[lp->txbpi++] = (char)(c); \ lp->txbpi %= lp->txbsz; \ diff --git a/sim_tmxr.h b/sim_tmxr.h index b90b3f4e..6d84aa8e 100644 --- a/sim_tmxr.h +++ b/sim_tmxr.h @@ -65,7 +65,6 @@ typedef int SERHANDLE; #define TMXR_V_VALID 15 #define TMXR_VALID (1 << TMXR_V_VALID) #define TMXR_MAXBUF 256 /* buffer size */ -#define TMXR_GUARD 12 /* buffer guard */ #define TMXR_DTR_DROP_TIME 500 /* milliseconds to drop DTR for 'pseudo' modem control */ #define TMXR_MODEM_RING_TIME 3 /* seconds to wait for DTR for incoming connections */