Trim trailing spaces as well
This commit is contained in:
parent
172a239edb
commit
97ec586b82
7
main.c
7
main.c
|
@ -99,7 +99,12 @@ void updateBlock(int i) {
|
||||||
int j = bytesRead - 1;
|
int j = bytesRead - 1;
|
||||||
while ((buffer[j] & 0b11000000) == 0x80)
|
while ((buffer[j] & 0b11000000) == 0x80)
|
||||||
j--;
|
j--;
|
||||||
buffer[j] = '\0';
|
buffer[j] = ' ';
|
||||||
|
|
||||||
|
// Trim trailing spaces
|
||||||
|
while (buffer[j] == ' ')
|
||||||
|
j--;
|
||||||
|
buffer[j + 1] = '\0';
|
||||||
|
|
||||||
if (bytesRead == LEN(buffer)) {
|
if (bytesRead == LEN(buffer)) {
|
||||||
// Clear the pipe
|
// Clear the pipe
|
||||||
|
|
Loading…
Reference in New Issue