JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
abc...
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index 265ffb9..14cf3f9 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -568,8 +568,8 @@ drawsquare(Bool filled, Bool empty, Bool invert, unsigned long col[ColLast]) {
 
 void
 drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
-       int i, x, y, h, len, olen;
        char buf[256];
+       int i, x, y, h, len, olen;
        XRectangle r = { dc.x, dc.y, dc.w, dc.h };
 
        XSetForeground(dpy, dc.gc, col[invert ? ColFG : ColBG]);
@@ -581,7 +581,7 @@ drawtext(const char *text, unsigned long col[ColLast], Bool invert) {
        y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
        x = dc.x + (h / 2);
        /* shorten text if necessary */
-       for(len = MIN(olen, sizeof buf); len && (i = textnw(buf, len)) > dc.w - h; len--);
+       for(len = MIN(olen, sizeof buf); len && textnw(buf, len) > dc.w - h; len--);
        if(!len)
                return;
        memcpy(buf, text, len);