summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-05-17 14:09:42 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-05-17 14:09:42 +0200
commitc3d53d588dedb007b26809d85187027d1eba8183 (patch)
tree64f65cb1538b6ed43f246cb52961e336a01f202d /src/input_handler.cc
parent37a23633019b070b69e4e5e5b6804a5d94722342 (diff)
revive str_to_int so that the good exception type is thrown on error
Diffstat (limited to 'src/input_handler.cc')
-rw-r--r--src/input_handler.cc6
1 files changed, 3 insertions, 3 deletions
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)