Skip to content

Commit

Permalink
Added a check for zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhop committed Aug 23, 2023
1 parent 6272a8f commit f34bd18
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/replace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ inline std::string replace(const char *data, size_t size, const std::vector<re2:
{
result += (std::string)groups[index2];
continue;
} else if (index < groups.size()) {
}
else if (index && index < groups.size())
{
result += (std::string)groups[index];
result += ch;
continue;
Expand Down

0 comments on commit f34bd18

Please sign in to comment.