From f47a157e57c81b27bd3f04eed422ca068b70b7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=9Cmit=20=C3=96zden?= Date: Sun, 26 Sep 2021 14:26:30 +0300 Subject: [PATCH] \0 delimeter issue fixed --- dwmblocks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dwmblocks.c b/dwmblocks.c index ded717c..befd252 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -70,9 +70,9 @@ void getcmd(const Block *block, char *output) pclose(cmdf); return; } + //only chop off newline if one is present at the end + i = output[i-1] == '\n' ? i-1 : i; if (delim[0] != '\0') { - //only chop off newline if one is present at the end - i = output[i-1] == '\n' ? i-1 : i; strncpy(output+i, delim, delimLen); } else