mirror of
https://github.com/mintycube/dwmblocks.git
synced 2024-10-22 14:05:47 +02:00
Properly take care of the underscore in command outputs
This commit is contained in:
parent
3fff34b8da
commit
22916019dc
10
main.c
10
main.c
@ -78,7 +78,6 @@ int getStatus(char* new, char* old) {
|
||||
}
|
||||
|
||||
void updateBlock(int i) {
|
||||
char* output = outputs[i];
|
||||
char buffer[LEN(outputs[0])];
|
||||
int bytesRead = read(pipes[i][0], buffer, LEN(buffer));
|
||||
buffer[bytesRead - 1] = '\0';
|
||||
@ -90,10 +89,13 @@ void updateBlock(int i) {
|
||||
;
|
||||
}
|
||||
|
||||
if (blocks[i].signal > 0)
|
||||
buffer[0] = blocks[i].signal;
|
||||
char* output = outputs[i];
|
||||
if (blocks[i].signal > 0) {
|
||||
output[0] = blocks[i].signal;
|
||||
output++;
|
||||
}
|
||||
|
||||
strcpy(output, buffer);
|
||||
strcpy(output, buffer + 1);
|
||||
}
|
||||
|
||||
void debug() {
|
||||
|
Loading…
Reference in New Issue
Block a user