From 23315cf8571977bd02210fcdbf1abb7bb122a4b3 Mon Sep 17 00:00:00 2001 From: Ray Chason Date: Mon, 17 Aug 2026 19:27:00 -0400 Subject: [PATCH] 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. --- win/X11/winX.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/win/X11/winX.c b/win/X11/winX.c index 77b84ae78..1a86c3b3d 100644 --- a/win/X11/winX.c +++ b/win/X11/winX.c @@ -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 */