1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Bug fix from Robert de Bath: if wc_to_mb returns a length of zero, it

will not even initialise sbstring[0], so we shouldn't even look at it
let alone depend on it to tell us the desired character was absent.

[originally from svn r9465]
This commit is contained in:
Simon Tatham 2012-04-22 14:22:08 +00:00
parent f030975da7
commit b81b04f9b2

View File

@ -430,7 +430,7 @@ static int x11font_has_glyph(unifont *font, wchar_t glyph)
char sbstring[2];
int sblen = wc_to_mb(xfont->real_charset, 0, &glyph, 1,
sbstring, 2, "", NULL, NULL);
if (!sbstring[0])
if (sblen == 0 || !sbstring[0])
return FALSE; /* not even in the charset */
return x11_font_has_glyph(xfont->fonts[0], 0,