]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Cope with XFontStructs having a NULL per_char array, which happened to
authorSimon Tatham <anakin@pobox.com>
Sat, 17 Sep 2011 14:50:18 +0000 (14:50 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 17 Sep 2011 14:50:18 +0000 (14:50 +0000)
me this morning under strange circumstances.

[originally from svn r9303]

unix/gtkfont.c

index ebdc4bceb0e23e991d9a3c99951cf4730d8a01f3..0f2dc58151380856af7219e69b65f309bdc66255 100644 (file)
@@ -280,6 +280,9 @@ static int x11_font_has_glyph(XFontStruct *xfs, int byte1, int byte2)
                   (xfs->max_char_or_byte2 - xfs->min_char_or_byte2 + 1)));
     }
 
+    if (!xfs->per_char)   /* per_char NULL => everything in range exists */
+        return TRUE;
+
     return (xfs->per_char[index].ascent + xfs->per_char[index].descent > 0 ||
             xfs->per_char[index].width > 0);
 }