From 0bd457557437834bb21d48ac80a1e6413540d8ab Mon Sep 17 00:00:00 2001 From: keikari <34790748+keikari@users.noreply.github.com> Date: Sat, 15 Aug 2020 21:43:18 +0300 Subject: [PATCH 1/3] Small fix delimLen didn't count in null-terminator. On line 62 the null terminator character doesn't get copied. --- dwmblocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwmblocks.c b/dwmblocks.c index e3ac034..63d1547 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -178,7 +178,7 @@ int main(int argc, char** argv) else if(!strcmp("-p",argv[i])) writestatus = pstdout; } - delim[MIN(delimLen, strlen(delim))] = '\0'; + delim[MIN(delimLen++, strlen(delim))] = '\0'; signal(SIGTERM, termhandler); signal(SIGINT, termhandler); statusloop(); From 86d7ae90b7a9f1b9412d18c132c8307b8ee45bd0 Mon Sep 17 00:00:00 2001 From: keikari <34790748+keikari@users.noreply.github.com> Date: Sun, 16 Aug 2020 12:20:15 +0300 Subject: [PATCH 2/3] Update dwmblocks.c --- dwmblocks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dwmblocks.c b/dwmblocks.c index 63d1547..2ce251e 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -178,7 +178,8 @@ int main(int argc, char** argv) else if(!strcmp("-p",argv[i])) writestatus = pstdout; } - delim[MIN(delimLen++, strlen(delim))] = '\0'; + delim = MIN(delimLen, strlen(delim)); + delim[delimLen++] = '\0'; signal(SIGTERM, termhandler); signal(SIGINT, termhandler); statusloop(); From d581dae18025f141d401747b8265fa9c84e8445a Mon Sep 17 00:00:00 2001 From: keikari <34790748+keikari@users.noreply.github.com> Date: Sun, 16 Aug 2020 12:21:46 +0300 Subject: [PATCH 3/3] Update dwmblocks.c --- dwmblocks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwmblocks.c b/dwmblocks.c index 2ce251e..2014eee 100644 --- a/dwmblocks.c +++ b/dwmblocks.c @@ -178,7 +178,7 @@ int main(int argc, char** argv) else if(!strcmp("-p",argv[i])) writestatus = pstdout; } - delim = MIN(delimLen, strlen(delim)); + delimLen = MIN(delimLen, strlen(delim)); delim[delimLen++] = '\0'; signal(SIGTERM, termhandler); signal(SIGINT, termhandler);