--- rxvt-unicode/src/rxvtfont.C 2012/01/17 20:27:41 1.183 +++ rxvt-unicode/src/rxvtfont.C 2012/05/17 20:05:55 1.189 @@ -24,7 +24,7 @@ #include "rxvtutil.h" #include "rxvtfont.h" -#include +#include #include @@ -818,10 +818,10 @@ // this loop only iterates when the guessed font-size is too small for (;;) { - font_weight *best = fonts + count - 1; + font_weight *best = fonts; - for (font_weight *w = fonts; w < fonts + count - 1; w++) - if (w->diff <= best->diff) + for (font_weight *w = fonts + 1; w < fonts + count; w++) + if (w->diff < best->diff) best = w; if (!best->name @@ -1501,7 +1501,7 @@ (*i)->unref (); for (pagemap **p = fmap.begin (); p != fmap.end (); p++) - delete *p; + delete [] *p; free (fontdesc); fontdesc = 0; @@ -1787,7 +1787,7 @@ if (!fmap[hi]) { - fmap[hi] = (pagemap *)new pagemap; + fmap[hi] = new pagemap; memset (fmap[hi], 0xff, sizeof (pagemap)); }