On Sun, Jun 01, 2008 at 01:21:03PM +0200, Premysl Hruby wrote:
> Not much readable (because it firstly looks like it's error (buf maybe
> not ended with \0)). I am against using strncpy in case that dest string
> is not C string, but char[] + length.
> 
> Maybe:
> 
> memcpy(&buf[MAX(0, len - 3)], "...", 3);
> 
> would be somewhat better ;)
> 
> 
> >     XSetForeground(dpy, dc.gc, col[invert ? ColBG : ColFG]);
> >     if(dc.font.set)
> >             XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, 
> > len);

I though a while about this, and I think the memcpy() idea is
best.

Kind regards,
-- 
 Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361

Reply via email to