X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=drw.c;h=b13040565f6c01bec3f5927cbf7fcd30409f7c3d;hp=bc4ac41da655288058589860241ac5d31d44ba1f;hb=7fb0771af631512715ee98315ac2382d1730b3d5;hpb=33a74489f036600bb80a3c34fcdf10e5f9dafae1 diff --git a/drw.c b/drw.c index bc4ac41..b130405 100644 --- a/drw.c +++ b/drw.c @@ -157,7 +157,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *tex ty = y + (h / 2) - (th / 2) + drw->font->ascent; tx = x + (h / 2); /* shorten text if necessary */ - for(len = MIN(olen, sizeof buf); len && tex.w > w - tex.h; len--) + for(len = MIN(olen, sizeof buf); len && (tex.w > w - tex.h || w < tex.h); len--) drw_font_getexts(drw->font, text, len, &tex); if(!len) return;