1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Remove obsolete checks for ldisc_send with len == 0.

This reverts commit 4634cd47f7 and
commit 43a63019f5, both of which
introduced checks at ldisc_send call sites to avoid triggering the
assertion that len != 0 inside ldisc_send. Now that assertion is gone,
it's OK to call ldisc_send without checking the buffer size.
This commit is contained in:
Simon Tatham 2020-06-14 10:12:59 +01:00
parent cd3e917fd0
commit 2bbed67d9e

View File

@ -3412,8 +3412,7 @@ static void term_out(Terminal *term)
strbuf *buf = term_input_data_from_charset(
term, DEFAULT_CODEPAGE,
term->answerback, term->answerbacklen);
if (buf->len)
ldisc_send(term->ldisc, buf->s, buf->len, false);
ldisc_send(term->ldisc, buf->s, buf->len, false);
strbuf_free(buf);
}
break;
@ -3660,7 +3659,7 @@ static void term_out(Terminal *term)
break;
case 'Z': /* DECID: terminal type query */
compatibility(VT100);
if (term->ldisc && term->id_string[0])
if (term->ldisc)
ldisc_send(term->ldisc, term->id_string,
strlen(term->id_string), false);
break;
@ -3974,7 +3973,7 @@ static void term_out(Terminal *term)
case 'c': /* DA: terminal type query */
compatibility(VT100);
/* This is the response for a VT102 */
if (term->ldisc && term->id_string[0])
if (term->ldisc)
ldisc_send(term->ldisc, term->id_string,
strlen(term->id_string), false);
break;
@ -4419,8 +4418,7 @@ static void term_out(Terminal *term)
len = strlen(p);
ldisc_send(term->ldisc, "\033]L", 3,
false);
if (len > 0)
ldisc_send(term->ldisc, p, len, false);
ldisc_send(term->ldisc, p, len, false);
ldisc_send(term->ldisc, "\033\\", 2,
false);
}
@ -4435,8 +4433,7 @@ static void term_out(Terminal *term)
len = strlen(p);
ldisc_send(term->ldisc, "\033]l", 3,
false);
if (len > 0)
ldisc_send(term->ldisc, p, len, false);
ldisc_send(term->ldisc, p, len, false);
ldisc_send(term->ldisc, "\033\\", 2,
false);
}