From ed68d1ff287d43c5293abb4d41e908aa8e50afec Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 2 Jul 2014 21:14:01 +0100 Subject: utf8: use end of sequence iterators for more security --- src/insert_completer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/insert_completer.cc') diff --git a/src/insert_completer.cc b/src/insert_completer.cc index aab807f1..2acc5447 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -32,7 +32,7 @@ template InsertCompletion complete_word(const Buffer& buffer, ByteCoord cursor_pos) { auto pos = buffer.iterator_at(cursor_pos); - if (pos == buffer.begin() or not is_word(*utf8::previous(pos))) + if (pos == buffer.begin() or not is_word(*utf8::previous(pos, buffer.begin()))) return {}; auto end = buffer.iterator_at(cursor_pos); -- cgit v1.2.3