Compare commits

...

2 Commits

Author SHA1 Message Date
Hiltjo Posthuma 86f0b5119e remove extra newline 2024-10-30 13:03:25 +01:00
Hiltjo Posthuma dd3d348ae8 Avoid unsigned integer underflow in drw_text()
Patch by Raymond Cole <rc@wolog.xyz>, thanks.
2024-10-30 13:02:57 +01:00
2 changed files with 2 additions and 1 deletions

View File

@ -689,7 +689,6 @@ setup(void)
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
XSetClassHint(dpy, win, &ch);
/* input methods */
if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL)
die("XOpenIM failed: could not open input device");

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