X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=dbc49972399c1acd54018a8191880459fa7a8545;hp=123707c32317a48b388d7dd2db171a75da9db8d3;hb=88e6eb4a3a3552d6b503481164aafc1c994d5a50;hpb=077d3e435baec5faa8182aea29723663ee6ae778 diff --git a/dwm.c b/dwm.c index 123707c..dbc4997 100644 --- a/dwm.c +++ b/dwm.c @@ -166,7 +166,7 @@ void setmfact(const void *arg); void setup(void); void spawn(const void *arg); void tag(const void *arg); -uint textnw(const char *text, uint len); +int textnw(const char *text, uint len); void tile(void); void togglebar(const void *arg); void togglefloating(const void *arg); @@ -296,7 +296,8 @@ attachstack(Client *c) { void buttonpress(XEvent *e) { - uint i, x, mask; + uint i, mask; + int x; Client *c; XButtonPressedEvent *ev = &e->xbutton; @@ -570,7 +571,7 @@ drawtext(const char *text, ulong col[ColLast], Bool invert) { if(!len) return; if(len < olen) - for(i = len; i && i > len - 3; buf[--i] = '.'); + for(i = len; i >= MAX(0, len - 3); buf[i--] = '.'); 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); @@ -1308,7 +1309,8 @@ setmfact(const void *arg) { void setup(void) { - uint i, w; + uint i; + int w; XSetWindowAttributes wa; /* init screen */ @@ -1413,7 +1415,7 @@ tag(const void *arg) { } } -uint +int textnw(const char *text, uint len) { XRectangle r;