mirror of git://git.suckless.org/dwm
Avoid unsigned integer underflow in drw_text()
This commit is contained in:
parent
fcb2476b69
commit
cfb8627a80
2
drw.c
2
drw.c
|
@ -248,6 +248,8 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
|
||||||
} else {
|
} else {
|
||||||
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
|
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
|
||||||
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
|
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
|
||||||
|
if (w < lpad)
|
||||||
|
return x + w;
|
||||||
d = XftDrawCreate(drw->dpy, drw->drawable,
|
d = XftDrawCreate(drw->dpy, drw->drawable,
|
||||||
DefaultVisual(drw->dpy, drw->screen),
|
DefaultVisual(drw->dpy, drw->screen),
|
||||||
DefaultColormap(drw->dpy, drw->screen));
|
DefaultColormap(drw->dpy, drw->screen));
|
||||||
|
|
Loading…
Reference in New Issue