drw_text: don't segfault when called with 0 width e4827b0c
this patch just rejects *any* 0 width draws, which is surely an error by
the caller.

this also guards against cases where the width is too small for the
ellipsis to fit, so ellipsis_w will remain 0.
reported by Bakkeby <bakkeby@gmail.com>
NRK · 2022-03-28 01:02 1 file(s) · +1 −1
drw.c +1 −1
267 267
	enum { nomatches_len = 64 };
268 268
	static struct { long codepoint[nomatches_len]; unsigned int idx; } nomatches;
269 269
270 -
	if (!drw || (render && !drw->scheme) || !text || !drw->fonts)
270 +
	if (!drw || (render && (!drw->scheme || !w)) || !text || !drw->fonts)
271 271
		return 0;
272 272
273 273
	if (!render) {