From 7edb97a4acfee0cbd2beda84dd2b8e1f3dbd7dc0 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 14 Jul 2024 11:40:20 +0200 Subject: drw.c: use the same pattern as ellipsis_width to check for infinite recursion --- drw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drw.c') diff --git a/drw.c b/drw.c index f151ae5..344de61 100644 --- a/drw.c +++ b/drw.c @@ -258,10 +258,8 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp usedfont = drw->fonts; if (!ellipsis_width && render) ellipsis_width = drw_fontset_getwidth(drw, "..."); - if (!invalid_width) { - invalid_width = -1; /* stop infinite recursion */ + if (!invalid_width && render) invalid_width = drw_fontset_getwidth(drw, invalid); - } while (1) { ew = ellipsis_len = utf8err = utf8charlen = utf8strlen = 0; utf8str = text; -- cgit v1.2.3