From b934c8ede532284e5c961e10f1d7591d4e4de1a7 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 23 Jun 2014 13:16:51 +0100 Subject: [PATCH] Fix crash in Context::main_sel_register_value --- src/context.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context.cc b/src/context.cc index 64bf8a4c..93bf8a7f 100644 --- a/src/context.cc +++ b/src/context.cc @@ -231,7 +231,7 @@ StringView Context::main_sel_register_value(StringView reg) const { auto strings = RegisterManager::instance()[reg].values(*this); size_t index = m_selections ? (*m_selections).main_index() : 0; - if (strings.size() < index) + if (strings.size() <= index) index = strings.size() - 1; return strings[index]; }