X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/8a0c25526881df05f81c34264c4e37b0caff3d7e..cb5488c53f54fbdb36ce3f43bbf72d32c002b26a:/unix/gtkfont.c diff --git a/unix/gtkfont.c b/unix/gtkfont.c index 123731a1..56ae0315 100644 --- a/unix/gtkfont.c +++ b/unix/gtkfont.c @@ -2288,6 +2288,8 @@ static fontinfo *update_for_intended_size(unifontsel_internal *fs, */ below = findrelpos234(fs->fonts_by_selorder, &info2, NULL, REL234_LE, &pos); + if (!below) + pos = -1; above = index234(fs->fonts_by_selorder, pos+1); /* @@ -2295,7 +2297,7 @@ static fontinfo *update_for_intended_size(unifontsel_internal *fs, * case. If we have, it'll be in `below' and not `above', * because we did a REL234_LE rather than REL234_LT search. */ - if (!fontinfo_selorder_compare(&info2, below)) + if (below && !fontinfo_selorder_compare(&info2, below)) return below; /*