From 0e398566d2069663a0f8075e9483afed513be10c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 28 Dec 2011 18:52:14 +0000 Subject: [PATCH] Buffer: fix compute_lines on empty_buffer --- src/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buffer.cc b/src/buffer.cc index fb0d0e827..4713290e6 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -102,7 +102,7 @@ void Buffer::compute_lines() { m_lines.clear(); m_lines.push_back(0); - for (BufferPos i = 0; i < m_content.size()-1; ++i) + for (BufferPos i = 0; i + 1 < m_content.size(); ++i) { if (m_content[i] == '\n') m_lines.push_back(i + 1);