dwm

personal fork of dwm (rnpnr branch)
git clone anongit@rnpnr.xyz:dwm.git
Log | Files | Refs | Feed | README | LICENSE

Commit: cfb8627a80a334f200f68c2c8f3e384313ebbaf5
Parent: fcb2476b693ca4c40ad32c7119e27bbeb856865c
Author: Raymond Cole
Date:   Mon, 28 Oct 2024 00:34:55 +0000

Avoid unsigned integer underflow in drw_text()

Diffstat:
Mdrw.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/drw.c b/drw.c @@ -248,6 +248,8 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp } else { XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); + if (w < lpad) + return x + w; d = XftDrawCreate(drw->dpy, drw->drawable, DefaultVisual(drw->dpy, drw->screen), DefaultColormap(drw->dpy, drw->screen));