if (XGetFontProperty(xfs, fontprop, &ret)) {
char *name = XGetAtomName(disp, (Atom)ret);
if (name && name[0] == '-') {
- char *strings[13];
+ const char *strings[13];
char *dupname, *extrafree = NULL, *ret;
char *p, *q;
int nstr;
p++;
}
- if (nstr < lenof(strings))
+ if (nstr < lenof(strings)) {
+ sfree(dupname);
return NULL; /* XLFD was malformed */
+ }
if (bold)
strings[2] = "bold";
*/
below = findrelpos234(fs->fonts_by_selorder, &info2, NULL,
REL234_LE, &pos);
+ if (!below)
+ pos = -1;
above = index234(fs->fonts_by_selorder, pos+1);
/*
* 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;
/*