Merge pull request #29 from keikari/patch-2
authortorrinfail <torrinfail@gmail.com>
Thu, 27 Aug 2020 06:51:30 +0000 (06:51 +0000)
committerGitHub <noreply@github.com>
Thu, 27 Aug 2020 06:51:30 +0000 (06:51 +0000)
Fix, delimLen caused weird behaviour

1  2 
dwmblocks.c

diff --cc dwmblocks.c
@@@ -175,10 -175,11 +175,11 @@@ int main(int argc, char** argv
        {
                if (!strcmp("-d",argv[i]))
                        strncpy(delim, argv[++i], delimLen);
 -              else if(!strcmp("-p",argv[i]))
 +              else if (!strcmp("-p",argv[i]))
                        writestatus = pstdout;
        }
-       delim[MIN(delimLen, strlen(delim))] = '\0';
+       delimLen = MIN(delimLen, strlen(delim));
+       delim[delimLen++] = '\0';
        signal(SIGTERM, termhandler);
        signal(SIGINT, termhandler);
        statusloop();