diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-03-08 20:49:10 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-03-08 20:49:10 +0000 |
| commit | c98657a512ed3431d875620803c10bace2802a13 (patch) | |
| tree | e47ccfbab82b3e4539dc8e027306123ecdedbf41 /src/buffer.cc | |
| parent | 8bc6ed6cbb4e1c19ea7bc85ec2313824b19b1cf2 (diff) | |
fix some unitialized variable use (thanks valgrind)
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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<BufferPos> 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 |
