--- rxvt-unicode/src/rxvtfont.C 2009/04/04 21:27:53 1.152 +++ rxvt-unicode/src/rxvtfont.C 2010/03/30 23:00:35 1.155 @@ -450,7 +450,7 @@ chrs [1] = NOCHAR; *chrs = cc->c1; - rxvt_font *f1 = (*fs)[fs->find_font (cc->c1)]; + rxvt_font *f1 = fs->get (cc->c1); f1->draw (d, x, y, chrs, width, fg, bg); if (cc->c2 != NOCHAR) @@ -461,7 +461,7 @@ *chrs = cc->c2; rxvt_font *f2 = (f1->has_char (cc->c2, 0, careful) && !careful) ? f1 - : (*fs)[fs->find_font (cc->c2)]; + : fs->get (cc->c2); f2->draw (d, x, y, chrs, width, fg, Color_none); } @@ -1295,7 +1295,7 @@ int fg, int bg) { XGlyphInfo extents; - XftGlyphSpec *enc = (XftGlyphSpec *)rxvt_temp_buf (len * sizeof (XftGlyphSpec)); + XftGlyphSpec *enc = rxvt_temp_buf (len); XftGlyphSpec *ep = enc; dTermDisplay; @@ -1588,7 +1588,7 @@ } int -rxvt_fontset::find_font (unicode_t unicode) +rxvt_fontset::find_font_ (unicode_t unicode) { if (unicode >= 1<<20) return 0; @@ -1677,7 +1677,7 @@ if (find_font (font) < 0) { char fontname[4096]; - sprintf (fontname, "xft:%-.4090s", font); + snprintf (fontname, sizeof (fontname), "xft:%s", font); fonts.push_back (new_font (fontname, CS_UNICODE)); } @@ -1711,5 +1711,11 @@ return i; } +int +rxvt_fontset::find_font (unicode_t unicode) +{ + return min (fontCount, find_font_ (unicode)); +} +