summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2024-07-14 11:40:20 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2024-07-14 11:43:01 +0200
commit475d8093cb8d29d5756937bfa9e0b3b9e415f632 (patch)
treecd3a09a6aae39e7b80ed2c610cf648728306ef06
parent59936c7d972587a47d61161279bb8e8abc0b02f3 (diff)
downloaddmenu-475d8093cb8d29d5756937bfa9e0b3b9e415f632.tar.gz
dmenu-475d8093cb8d29d5756937bfa9e0b3b9e415f632.zip
drw.c: use the same pattern as ellipsis_width to check for infinite recursion
-rw-r--r--drw.c4
1 files changed, 1 insertions, 3 deletions
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;