From c98657a512ed3431d875620803c10bace2802a13 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 8 Mar 2012 20:49:10 +0000 Subject: fix some unitialized variable use (thanks valgrind) --- src/buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/buffer.cc') diff --git a/src/buffer.cc b/src/buffer.cc index 175cffdd..d62d2e82 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -214,7 +214,7 @@ void Buffer::update_lines(const Modification& modification) std::vector new_lines; // if we inserted at the end of the buffer, we may have created a new // line without inserting a '\n' - if (endpos == m_content.size() and m_content[pos-1] == '\n') + if (endpos == m_content.size() and pos > 0 and m_content[pos-1] == '\n') new_lines.push_back(pos); // every \n inserted that was not the last buffer character created a -- cgit v1.2.3