From add43beb92608b88f99de16153a6795032738884 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sat, 28 Jan 2017 12:23:58 -0500 Subject: [PATCH] fix bug counting lines to adjust iterators by in Buffer::lines_in_data() --- src/core/Buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Buffer.cc b/src/core/Buffer.cc index 6040b47..1856f58 100644 --- a/src/core/Buffer.cc +++ b/src/core/Buffer.cc @@ -229,7 +229,7 @@ size_t Buffer::lines_in_data(size_t offset, size_t length) for (size_t i = 0u; i < length; ) { uint8_t bytes; - uint32_t c = Encoding::decode(m_encoding, m_gap_buffer->address(offset), &bytes); + uint32_t c = Encoding::decode(m_encoding, m_gap_buffer->address(offset + i), &bytes); if (c == '\n') { lines++;