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) {
|
void updateBlock(int i) {
|
||||||
char* output = outputs[i];
|
|
||||||
char buffer[LEN(outputs[0])];
|
char buffer[LEN(outputs[0])];
|
||||||
int bytesRead = read(pipes[i][0], buffer, LEN(buffer));
|
int bytesRead = read(pipes[i][0], buffer, LEN(buffer));
|
||||||
buffer[bytesRead - 1] = '\0';
|
buffer[bytesRead - 1] = '\0';
|
||||||
|
@ -90,10 +89,13 @@ void updateBlock(int i) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blocks[i].signal > 0)
|
char* output = outputs[i];
|
||||||
buffer[0] = blocks[i].signal;
|
if (blocks[i].signal > 0) {
|
||||||
|
output[0] = blocks[i].signal;
|
||||||
|
output++;
|
||||||
|
}
|
||||||
|
|
||||||
strcpy(output, buffer);
|
strcpy(output, buffer + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void debug() {
|
void debug() {
|
||||||
|
|
Loading…
Reference in New Issue