From deaeb2a28752a858a8be00ae57f7a326f1792bbb Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 20 Jul 2004 20:13:25 +0000 Subject: [PATCH] We shouldn't reference off the end of the display line when checking for UCSWIDE. Thanks Jacob, for catching this with valgrind. [originally from svn r4338] --- terminal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/terminal.c b/terminal.c index 3b149234..bf531eee 100644 --- a/terminal.c +++ b/terminal.c @@ -3573,8 +3573,9 @@ static void do_paint(Terminal *term, Context ctx, int may_optimise) } tattr |= (tchar & CSET_MASK); tchar &= CHAR_MASK; - if ((d[1] & (CHAR_MASK | CSET_MASK)) == UCSWIDE) - tattr |= ATTR_WIDE; + if (j < term->cols-1 && + (d[1] & (CHAR_MASK | CSET_MASK)) == UCSWIDE) + tattr |= ATTR_WIDE; /* Video reversing things */ if (term->selstate == DRAGGING || term->selstate == SELECTED) { -- 2.45.2