From c3d53d588dedb007b26809d85187027d1eba8183 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 17 May 2013 14:09:42 +0200 Subject: revive str_to_int so that the good exception type is thrown on error --- src/input_handler.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/input_handler.cc') diff --git a/src/input_handler.cc b/src/input_handler.cc index 7f3387c1..875618ce 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -536,17 +536,17 @@ static BufferCompletion complete_opt(const BufferIterator& pos, OptionManager& o boost::smatch match; if (boost::regex_match(desc.begin(), desc.end(), match, re)) { - BufferCoord coord{ stoi(match[1].str()) - 1, stoi(match[2].str()) - 1 }; + BufferCoord coord{ str_to_int(match[1].str()) - 1, str_to_int(match[2].str()) - 1 }; if (not pos.buffer().is_valid(coord)) return {}; BufferIterator beg{pos.buffer(), coord}; BufferIterator end = beg; if (match[3].matched) { - ByteCount len = stoi(match[3].str()); + ByteCount len = str_to_int(match[3].str()); end = beg + len; } - size_t timestamp = (size_t)stoi(match[4].str()); + size_t timestamp = (size_t)str_to_int(match[4].str()); size_t longest_completion = 0; for (auto it = opt.begin() + 1; it != opt.end(); ++it) -- cgit v1.2.3