wmsl

Block-based window manager status line
git clone https://git.sinitax.com/sinitax/wmsl
Log | Files | Refs | README | LICENSE | sfeed.txt

commit 2ef6e8a4e4c1487f74aadfffcded95d67caae02d
parent d0d90c47f89b179822e0974c02c6b624d03f888b
Author: Louis Burda <quent.burda@gmail.com>
Date:   Tue, 29 Sep 2020 12:19:20 +0200

Improve handling of too long status texts

Diffstat:
Mwmsl.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/wmsl.c b/wmsl.c @@ -80,10 +80,11 @@ void concat_status(const char *text, size_t len) { if (status_len + len + 1 > STATUSMAX) - die(EXIT_FAILURE, "wmsl: status line too large (>%i)\n", - STATUSMAX); + len = STATUSMAX - status_len; memcpy(&status_text[status_len], text, len); status_len += len; + if (status_len == STATUSMAX) + strcpy(&status_text[status_len - 4], "..."); status_text[status_len] = '\0'; }