From: simon 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-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/6a9228348cf566c2afd7632deacf1582773f2163 Cope with XFontStructs having a NULL per_char array, which happened to me this morning under strange circumstances. git-svn-id: svn://svn.tartarus.org/sgt/putty@9303 cda61777-01e9-0310-a592-d414129be87e --- 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); }