Skip to content

Commit f34bd18

Browse files
committed
Added a check for zero.
1 parent 6272a8f commit f34bd18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/replace.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ inline std::string replace(const char *data, size_t size, const std::vector<re2:
141141
{
142142
result += (std::string)groups[index2];
143143
continue;
144-
} else if (index < groups.size()) {
144+
}
145+
else if (index && index < groups.size())
146+
{
145147
result += (std::string)groups[index];
146148
result += ch;
147149
continue;

0 commit comments

Comments
 (0)