]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
We shouldn't reference off the end of the display line when checking
authorSimon Tatham <anakin@pobox.com>
Tue, 20 Jul 2004 20:13:25 +0000 (20:13 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 20 Jul 2004 20:13:25 +0000 (20:13 +0000)
for UCSWIDE. Thanks Jacob, for catching this with valgrind.

[originally from svn r4338]

terminal.c

index 3b149234377a00d40774319a329393538d63dfb0..bf531eee8252e557c31ca44b0c8a81cf7e45f279 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) {