Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix off-by-one in log output line length (#6896)
- Loading branch information
Showing
with
2 additions
and
5 deletions.
-
+2
−5
src/log.cpp
|
@@ -347,13 +347,10 @@ void StringBuffer::push_back(char c) |
|
|
flush(std::string(buffer, buffer_index)); |
|
|
buffer_index = 0; |
|
|
} else { |
|
|
int index = buffer_index; |
|
|
buffer[index++] = c; |
|
|
if (index >= BUFFER_LENGTH) { |
|
|
buffer[buffer_index++] = c; |
|
|
if (buffer_index >= BUFFER_LENGTH) { |
|
|
flush(std::string(buffer, buffer_index)); |
|
|
buffer_index = 0; |
|
|
} else { |
|
|
buffer_index = index; |
|
|
} |
|
|
} |
|
|
} |
|
|