projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b5e261
)
Fix off-by-one in log output line length (#6896)
author
Pedro Gimeno
<4267396+pgimeno@users.noreply.github.com>
Tue, 9 Jan 2018 18:07:14 +0000
(19:07 +0100)
committer
SmallJoker
<mk939@ymail.com>
Sun, 3 Jun 2018 15:32:00 +0000
(17:32 +0200)
src/log.cpp
patch
|
blob
|
history
diff --git
a/src/log.cpp
b/src/log.cpp
index 589cfd909806ee7ba6be55d720c6f06ba486a6bf..0dec7dd7053fc8d0525ae3a68e497de961d0ff29 100644
(file)
--- a/
src/log.cpp
+++ b/
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;
}
}
}