Cope with XFontStructs having a NULL per_char array, which happened to
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 17 Sep 2011 14:50:18 +0000 (14:50 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 17 Sep 2011 14:50:18 +0000 (14:50 +0000)
me this morning under strange circumstances.

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

unix/gtkfont.c

index ebdc4bc..0f2dc58 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);
 }