Skip to content
Permalink
Browse files

Fix off-by-one in log output line length (#6896)

  • Loading branch information...
Pedro Gimeno authored and SmallJoker committed Jan 9, 2018
1 parent 63f4ee2 commit f77f19a9412c9ae9f6b54a8794af219861a5e2e2
Showing with 2 additions and 5 deletions.
  1. +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;
}
}
}

0 comments on commit f77f19a

Please sign in to comment.
You can’t perform that action at this time.