using anydot's memcpy-approach in drawtext, however it still looks awkward to me
authorAnselm R Garbe <garbeam@gmail.com>
Sun, 1 Jun 2008 16:41:15 +0000 (17:41 +0100)
committerAnselm R Garbe <garbeam@gmail.com>
Sun, 1 Jun 2008 16:41:15 +0000 (17:41 +0100)
dwm.c

diff --git a/dwm.c b/dwm.c
index 3b6efaa..90ce40d 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -572,7 +572,7 @@ drawtext(const char *text, ulong col[ColLast], Bool invert) {
        if(!len)
                return;
        if(len < olen)
-               strncpy(&buf[MAX(0, len - 3)], "...", len);
+               memcpy(&buf[MAX(0, len - 3)], "...", 3);
        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);