]> Skullheadx's Git Forge - dmenu.git/commitdiff
drw.c: use the same pattern as ellipsis_width to check for infinite recursion
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 14 Jul 2024 09:40:20 +0000 (11:40 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 14 Jul 2024 09:43:01 +0000 (11:43 +0200)
drw.c

diff --git a/drw.c b/drw.c
index f151ae5e2780f77aaad53ab9d7255efe9e981311..344de618bae0094f955f679a23b9d1d460c6ab39 100644 (file)
--- 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;