Skip to content

Commit

Permalink
\0 delimeter issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetumit committed Sep 26, 2021
1 parent 96cbb45 commit f47a157
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dwmblocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f47a157

Please sign in to comment.