From: Simon Tatham Date: Sat, 17 Sep 2011 14:50:18 +0000 (+0000) Subject: Cope with XFontStructs having a NULL per_char array, which happened to X-Git-Tag: 0.63~255 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=0c4a041f9b2d2723d851eaa51251f55600e6ad39;p=PuTTY.git Cope with XFontStructs having a NULL per_char array, which happened to me this morning under strange circumstances. [originally from svn r9303] --- diff --git a/unix/gtkfont.c b/unix/gtkfont.c index ebdc4bce..0f2dc581 100644 --- a/unix/gtkfont.c +++ b/unix/gtkfont.c @@ -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); }