We shouldn't reference off the end of the display line when checking
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 20 Jul 2004 20:13:25 +0000 (20:13 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 20 Jul 2004 20:13:25 +0000 (20:13 +0000)
for UCSWIDE. Thanks Jacob, for catching this with valgrind.

git-svn-id: svn://svn.tartarus.org/sgt/putty@4338 cda61777-01e9-0310-a592-d414129be87e

terminal.c

index 3b14923..bf531ee 100644 (file)
@@ -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) {