Commit 07c1837c authored by Daniel Elstner's avatar Daniel Elstner
Browse files

:get_substring_bounds): Sanity-check for index >= 0 too.

* src/pcreshell.cc (Pattern::get_substring_bounds): Sanity-check
for index >= 0 too.
parent 2a8576a7
2004-05-30 Daniel Elstner <daniel.elstner@gmx.net>
* src/pcreshell.cc (Pattern::get_substring_bounds): Sanity-check
for index >= 0 too.
2004-05-30 Daniel Elstner <daniel.elstner@gmx.net>
* src/mainwindow.cc (MainWindow::on_conf_value_changed): Remove
......
......@@ -154,7 +154,7 @@ int Pattern::match(const Glib::ustring& subject, int offset, MatchOptions option
std::pair<int,int> Pattern::get_substring_bounds(int index) const
{
g_return_val_if_fail(3 * index < ovecsize_, std::make_pair(-1, -1));
g_return_val_if_fail(index >= 0 && 3 * index < ovecsize_, std::make_pair(-1, -1));
return std::make_pair(ovector_[2 * index], ovector_[2 * index + 1]);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment