aboutsummaryrefslogtreecommitdiffstats
path: root/src/outputBuffer.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/outputBuffer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/outputBuffer.c b/src/outputBuffer.c
index bde118ff8..3620f826b 100644
--- a/src/outputBuffer.c
+++ b/src/outputBuffer.c
@@ -57,10 +57,11 @@ void clearOutputBuffer(OutputBuffer * cb) {
void flushOutputBuffer(OutputBuffer * cb) {
if(currentChunk == cb->end) {
- cb->end++;
- if(cb->end>=buffered_chunks) {
- cb->end = 0;
+ int next = cb->end+1;
+ if(next>=buffered_chunks) {
+ next = 0;
}
+ cb->end = next;
currentChunk = -1;
}
}