Skip to content

Commit

Permalink
Merge pull request #59 from mehmetumit/master
Browse files Browse the repository at this point in the history
\0 delimeter issue fixed
This was clearly just an oversight. Thanks for the fix!
  • Loading branch information
torrinfail authored Jan 7, 2022
2 parents 96cbb45 + f47a157 commit ba866be
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 ba866be

Please sign in to comment.