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.

(cherry picked from commit 2bbed67d9e)
This commit is contained in:
Simon Tatham 2020-06-14 10:12:59 +01:00
parent 6aa1dcb1ca
commit bbf6daf612

View File

@ -3406,8 +3406,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;
@ -3656,7 +3655,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;
@ -4431,8 +4430,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);
}
@ -4447,8 +4445,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);
}