Avoid unsigned integer underflow in drw_text()

Patch by Raymond Cole <rc@wolog.xyz>, thanks.
This commit is contained in:
Hiltjo Posthuma 2024-10-30 13:02:57 +01:00
parent 545031a076
commit dd3d348ae8
1 changed files with 2 additions and 0 deletions

2
drw.c
View File

@ -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));