summaryrefslogtreecommitdiff
path: root/util.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'util.hpp')
-rw-r--r--util.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/util.hpp b/util.hpp
index 2c3c3b9..5b90220 100644
--- a/util.hpp
+++ b/util.hpp
@@ -214,8 +214,10 @@ std::string RegexReplaceMany(std::string str, std::string regexstr, F func) {
offset += diff;
- std::get<0>(*(it + 1)) -= offset;
- std::get<1>(*(it + 1)) -= offset;
+ if (it + 1 != matches.end()) {
+ std::get<0>(*(it + 1)) -= offset;
+ std::get<1>(*(it + 1)) -= offset;
+ }
}
return str;