Combine XLoadFont and XQueryFont calls
The separate calls crash if the font does not exist; the combined call returns NULL, as the caller expects. Resolves #1508 and possibly #569.
This commit is contained in:
committed by
Pasi Kallinen
parent
ef5beb917a
commit
23315cf857
+1
-2
@@ -3125,8 +3125,7 @@ X11_unicode_font(Display *display, XFontStruct *font)
|
||||
strcpy(unicode_font + len, "iso10646-1");
|
||||
font_name = unicode_font;
|
||||
|
||||
Font font_id = XLoadFont(display, font_name);
|
||||
XFontStruct *unifont = XQueryFont(display, font_id);
|
||||
XFontStruct *unifont = XLoadQueryFont(display, font_name);
|
||||
return unifont;
|
||||
}
|
||||
#endif /* ENHANCED_SYMBOLS */
|
||||
|
||||
Reference in New Issue
Block a user