From: torrinfail Date: Thu, 27 Aug 2020 06:51:30 +0000 (+0000) Subject: Merge pull request #29 from keikari/patch-2 X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=3d308cafb0f3a56e9247e6a9aaf9da6e279a5bc6;p=dwmblocks.git Merge pull request #29 from keikari/patch-2 Fix, delimLen caused weird behaviour --- 3d308cafb0f3a56e9247e6a9aaf9da6e279a5bc6 diff --cc dwmblocks.c index b6f696f,2014eee..e3e34a1 --- a/dwmblocks.c +++ b/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();