--- rxvt-unicode/src/rxvtfont.C 2007/11/25 11:23:18 1.125 +++ rxvt-unicode/src/rxvtfont.C 2008/01/23 05:18:43 1.129 @@ -21,7 +21,6 @@ #include "../config.h" #include "rxvt.h" -#include "rxvtlib.h" #include "rxvtutil.h" #include "rxvtfont.h" @@ -634,7 +633,7 @@ { size_t len = field - name; *ptr = (char *)malloc (len + strlen (replace) + strlen (end) + 1); - strncpy (*ptr, name, len); + memcpy (*ptr, name, len); strcpy (*ptr + len, replace); strcat (*ptr, end); @@ -1299,15 +1298,15 @@ int w = term->fwidth * len; int h = term->fheight; - /* TODO: this logic needs some more thinking, since we no longer do pseudo-transparency. + /* * Maybe make buffering into a resource flag? Compile time option doesn't seems like a * good idea from the perspective of packaging for wide variety of user configs. */ - bool buffered = true + bool buffered = bg >= 0; #ifdef FORCE_UNBUFFERED_XFT - && bg >= 0 + buffered = false; #endif - ; + // cut trailing spaces while (len && text [len - 1] == ' ') len--; @@ -1343,9 +1342,9 @@ if (buffered) { - bool back_rendered = false; if (ep != enc) { + bool back_rendered = false; rxvt_drawable &d2 = d.screen->scratch_drawable (w, h); #ifdef HAVE_BG_PIXMAP @@ -1353,7 +1352,7 @@ { Picture dst = 0; - if (bg >= 0 && term->pix_colors[bg].c.color.alpha < 0x0ff00) + if (bg >= 0 && term->pix_colors[bg].c.color.alpha < 0xff00) dst = XftDrawPicture (d2); if (bg < 0 || dst != 0) @@ -1391,18 +1390,15 @@ XChangeGC (disp, gc, GCFillStyle, &gcv); } - if (bg >= 0) - { - Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); - XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); - } + Picture solid_color_pict = XftDrawSrcPicture (d2, &term->pix_colors[bg].c); + XRenderComposite (disp, PictOpOver, solid_color_pict, None, dst, 0, 0, 0, 0, 0, 0, w, h); back_rendered = true; } } #endif - if (bg >= 0 && !back_rendered) + if (!back_rendered) XftDrawRect (d2, &term->pix_colors[bg].c, 0, 0, w, h); XftDrawGlyphSpec (d2, &term->pix_colors[fg].c, f, enc, ep - enc); @@ -1535,7 +1531,7 @@ if (end - desc < 511) { - strncpy (buf, desc, end - desc); + memcpy (buf, desc, end - desc); buf[end - desc] = 0; fonts.push_back (new_font (buf, cs));