\0 delimeter issue fixed

This commit is contained in:
Mehmet Ümit Özden 2021-09-26 14:26:30 +03:00
parent 96cbb453e5
commit f47a157e57
1 changed files with 2 additions and 2 deletions

View File

@ -70,9 +70,9 @@ void getcmd(const Block *block, char *output)
pclose(cmdf);
return;
}
if (delim[0] != '\0') {
//only chop off newline if one is present at the end
i = output[i-1] == '\n' ? i-1 : i;
if (delim[0] != '\0') {
strncpy(output+i, delim, delimLen);
}
else